dotnet/roslyn

Explicit method group conversion suppresses unnecessary qualification warning

Open

#1,208 opened on Mar 12, 2015

View on GitHub
 (1 comment) (0 reactions) (0 assignees)C# (20,414 stars) (4,257 forks)batch import
Area-AnalyzersBughelp wanted

Description

using System;

class X {
    void M() { R((Action)this.M); }
    void R(Action a) { }
}

(Action) is highlighted as unnecessary, but this. isn't. Removing (Action) correctly highlights it in gray.

Typename qualifiers for static methods are similarly missed, but namespace qualifiers are not.

Contributor guide