dotnet/roslyn

Private extension methods are shown as null-unaware

Open

#80648 opened on Oct 10, 2025

View on GitHub
 (0 comments) (1 reaction) (0 assignees)C# (20,414 stars) (4,257 forks)batch import
Area-IDEhelp wanted

Description

Version Used: VS 18.0.0 Insiders [11109.219]

Steps to Reproduce: Show the quick info tooltip on each of the extension method invocations.

#nullable enable
static class Cx
{
    public static void M()
    {
        "".M1().M2().M3();
    }

    extension<T> (T s)
    {
        private T M1() => s;
        internal T M2() => s;
        public T M3() => s;
    }
}

Expected Behavior: As all extensions are declared in a nullable context, neither should show that is "not nullable aware".

Actual Behavior:

  • Hovering over M1() shows the signature and the notice "'M1' is not nullable aware."
  • Hovering over M2() and M3() shows the signature and no such notice.

Contributor guide