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

RSRP-287496: 'Create method from usage' should create generic method where necessary

$
0
0
Reporter Vladimir Reshetnikov (nikov) Vladimir Reshetnikov (nikov)
Created Dec 30, 2011 1:54:15 AM
Updated Jan 10, 2012 11:05:11 PM
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.Collections.Generic;

class Program
{
    static void Foo<T>(List<T> x)
    {
        Bar(x); // Create Bar from usage
    }
}


Actual result:

using System.Collections.Generic;

class Program
{
    static void Foo<T>(List<T> x)
    {
        Bar(x); // error CS1503: Argument 1: cannot convert from 'System.Collections.Generic.List<T>' to 'System.Collections.Generic.List<object>'
    }

    private static void Bar(List<object> objects)
    {
        throw new System.NotImplementedException();
    }
}


Expected:

using System.Collections.Generic;

class Program
{
    static void Foo<T>(List<T> x)
    {
        Bar(x); // OK
    }

    private static void Bar<T>(List<T> x)
    {
        throw new System.NotImplementedException();
    }
}

Viewing all articles
Browse latest Browse all 106942

Trending Articles



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