Skip to content

Parsing bug in recursive patterns #45757

@gafter

Description

@gafter

When parsing

class Program
{
    public D P1 { get; set; }
    void M()
    {
        _ = this is Program { P1: (1,  }
    }
}
class D
{
    public int P2 { get; set; }
}

the parser drops some tokens; we end up with

class Program
{
    public D P1 { get; set; }
    void M()
    {
        _ = this is Program { P1: (1}
    }
}
class D
{
    public int P2 { get; set; }
}

(note hte missing comma/space after (1) which can cause an assertion error.

The test PropertiesInRecursivePattern_PositionalInFirstProperty_AfterComma is skipped because of this.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions