dotnet/roslyn

EE: "Internal error in C# compiler" reported for typeof(T?)

Aperta

#47.648 aperta il 12 set 2020

 (1 commento) (0 reazioni) (0 assegnatari)C# (4257 fork)batch import
Area-InteractiveBugFeature - Nullable Type ParametersInteractive-Debugginghelp wanted

Metriche repository

Star
 (20.414 stelle)
Metriche merge PR
 (Merge medio 6g 17h) (256 PR mergiate in 30 g)

Descrizione

Debug the following:

#nullable enable

class Program
{
    static void F<T, U>(T t, U u)
        where T : class
    {
        System.Diagnostics.Debugger.Break();
    }

    static void Main(string[] args)
    {
        F("", "");
    }
}

At the breakpoint, evaluate either typeof(T?) or typeof(U?) in the EE.

Result: Internal error in the C# compiler

Guida contributor