Skip to content

Calling GetTypeInfo on CastExpressionSyntax.Type returns wrong nullable information #39122

@ryzngard

Description

@ryzngard
#nullable enable

using System;

class C
{
    void M()
    {
        object? o = null;
        var s = [|(string?)o|];
        Console.WriteLine(s);
    }
}

where [||] shows the CastExpressionSyntax being used.

image

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions