swiftlang / swiftlang/swift-syntax
No recovery when expecting `>` as a token prefix
Open
SwiftParser
- Dominant language
- Swift
- Stars
- 3.7k
- Forks
- 553
- Avg merge
- 5d 13h
- Merged PRs (30d)
- 16
Description
### Issue Kind
Bad Diagnostic Produced
### Source Code
```swift
protocol Test {}
```
### Description
Produces the following diagnostics
```
1 │ protocol Test {}
│ ├─ 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 https://github.com/apple/swift-syntax/pull/1910#discussion_r1266001556
Contributor guide
Assessment
This issue has not been assessed yet.