Quantcast
Channel: YouTrackReSharper (RSRP) - Bug and Issue Tracker
Viewing all articles
Browse latest Browse all 106942

RSRP-298646: 'Replace with method group' inserts erroneous

$
0
0
Reporter Vladimir Reshetnikov (nikov) Vladimir Reshetnikov (nikov)
Created May 1, 2012 3:20:08 AM
Updated May 1, 2012 3:20:36 AM
Priority Normal
Type Bug
Fix versions No Fix versions
State Submitted
Assignee Unassigned
Subsystem No subsystem
Affected versions No Affected versions
Fixed in build No Fixed in build
using System;
using System.Collections.Generic;
using System.Linq;

namespace QuickProj
{
    internal static class Program
    {
        private static void Main()
        {
            int[] x = { 1, 2 };
            new Lazy<IEnumerable<int>>(() => x.ToList()); // Replace with method group
        }
    }
}


Actual:

using System;
using System.Collections.Generic;
using System.Linq;

namespace QuickProj
{
    internal static class Program
    {
        private static void Main()
        {
            int[] x = { 1, 2 };
            new Lazy<IEnumerable<int>>(x.ToList<>); // error CS1525: Invalid expression term '>'
        }
    }
}


Expected:

using System;
using System.Collections.Generic;
using System.Linq;

namespace QuickProj
{
    internal static class Program
    {
        private static void Main()
        {
            int[] x = { 1, 2 };
            new Lazy<IEnumerable<int>>(x.ToList); // OK
        }
    }
}

Viewing all articles
Browse latest Browse all 106942

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>