consulo / consulo-csharp

Languages: C#
Apache License 2.0
50 stars 6 forks source link

Error and Code completion generic problem for extension method #506

Closed consulo-bot closed 6 years ago

consulo-bot commented 6 years ago

Original issue: https://github.com/consulo/consulo/issues/313. Moved by @VISTALL


Error and Code completion generic problem for extension method

using System.Collections.Generic;

public static class A {
    public static T Push<T>(this List<T> thiz, T item) {
        thiz.Add(item);
        return item;
    }
}

public class B {
    private List<int> List = new List<int>();

    private void J() {
        var a = List.Push(0); //Error
        List.Add(0); //Ok
        List. //No code completion
    }
}

public class C {
    private void J() {
        var List = new List<int>();
        var a = List.Push(0); //Error
        List. //No code completion
        List.Add(0); //Ok
    }
}
VISTALL commented 6 years ago

Looks like priority bug. Thanks