Skip to content

Empty generic parameter clause produces no diagnostic #1483

Closed
@SimplyDanny

Description

@SimplyDanny

Issue Kind

Bad Diagnostic Produced

Source Code

// Can be parsed and produces no diagnostics.
func f< >() {}

// Can be parsed. Printing the node or asking for the diagnostics leads to a crash.
func f<>() {} 

Description

In both examples, the "old" parser reports "Expected an identifier to name generic parameter" on > which is helpful, but not the real issue.

Best would be a message like "Generic parameter clause cannot be empty" or similar. It should be reported in both examples. The ParseDiagnosticsGenerator should not crash in the second example.

Metadata

Metadata

Assignees

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