Skip to content

No recovery when expecting > as a token prefix #1923

Open
@ahoppen

Description

@ahoppen

Issue Kind

Bad Diagnostic Produced

Source Code

protocol Test<Foo Bar> {}

Description

Produces the following diagnostics

1 │ protocol Test<Foo Bar> {}
  │                   ├─ error: expected '>' to end primary associated type clause
  │                   ╰─ error: unexpected code 'Bar>' in protocol

We should be consuming Bar as an unexpected token when looking for the closing > in the primary associated value clause. The tricky part is that none of our recovery infrastructure supports the recovery to a token prefix.

Came up in #1910 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    SwiftParserBugs in the (new) Parser written in SwiftbugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions