Skip to content

False warning: pattern matching on a field doesn't count as a use #52956

@alrz

Description

@alrz
class C
{
    C field1 = null;
    public static void Main()
    {        
        _ = new C() is { field1: {} }; // CS0414 (not expected)
    }
}
class C
{
    C field1;
    public static void Main()
    {        
        _ = new C() is { field1: {} }; // CS0169 (not expected)
    }
}

Test plan: #52468

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions