dotnet / roslyn-analyzers

MIT License
1.59k stars 466 forks source link

Analyzer should refer to constructors by type name instead of .ctor #4010

Closed terrajobst closed 4 years ago

terrajobst commented 4 years ago

Repro

static class Program
{
    public static void Main()
    {
        var x = new SomeWindowsSpecificApi();
    }
}

[SupportedOSPlatform("windows10.0")]
class SomeWindowsSpecificApi
{
}

Expected

'SomeWindowsSpecificApi' requires windows 10.0 version or later

Actual

'.ctor' requires windows 10.0 version or later

buyaa-n commented 4 years ago

Fixed with latest commit, thanks!