dotnet/roslyn

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

Open

#47,648 opened on Sep 12, 2020

View on GitHub
 (1 comment) (0 reactions) (0 assignees)C# (4,257 forks)batch import
Area-InteractiveBugFeature - Nullable Type ParametersInteractive-Debugginghelp wanted

Repository metrics

Stars
 (20,414 stars)
PR merge metrics
 (Avg merge 6d 17h) (256 merged PRs in 30d)

Description

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

Contributor guide