Skip to content

Bad diagnostic for generic parameter list on enum case #2273

Closed
@AnthonyLatsis

Description

@AnthonyLatsis

Issue Kind

Bad Diagnostic Produced

Source Code

enum Foo {
    case bar<T>(baz: T)
}
/Users/mac/Desktop/test.swift:106:13: error: consecutive declarations on a line must be separated by newline or ';' [bridged_error]
    case bar<T>(baz: T)
            ^
/Users/mac/Desktop/test.swift:106:13: note: insert newline [bridged_note]
    case bar<T>(baz: T)
            ^
/Users/mac/Desktop/test.swift:106:13: note: insert ';' [bridged_note]
    case bar<T>(baz: T)
            ^
            ;
/Users/mac/Desktop/test.swift:106:13: error: expected 'func' in function [bridged_error]
    case bar<T>(baz: T)
            ^
/Users/mac/Desktop/test.swift:106:13: note: insert 'func' [bridged_note]
    case bar<T>(baz: T)
            ^
            func 
/Users/mac/Desktop/test.swift:106:14: error: unexpected code 'T>' before parameter clause [bridged_error]
    case bar<T>(baz: T)

Description

Twin of swiftlang/swift#69036.

Metadata

Metadata

Assignees

Labels

SwiftParserBugs in the (new) Parser written in SwiftbugSomething isn't workinggood first issueGood for newcomers

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions