dotnet/roslyn

Private extension methods are shown as null-unaware

開放

#80,648 建立於 2025年10月10日

 (0 則留言) (1 個反應) (0 位負責人)C# (4,257 個分叉)batch import
Area-IDEhelp wanted

倉庫指標

星標
 (20,414 顆星)
PR 合併指標
 (平均合併 6天 17小時) (30 天內合併 256 個 PR)

描述

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.

貢獻者指南