Skip to content

[Parser] Improve diagnostics for generic parameter list in enum cases #69052

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed

Conversation

mininny
Copy link
Contributor

@mininny mininny commented Oct 8, 2023

enum Foo {
    case bar<T>(baz: T)
            ^
}

above code results in

Consecutive declarations on a line must be separated by ';'
Expected declaration

which is not very helpful for informing the user that generics are not available as a case in enums.

Something like enum cases cannot have generic parameters. did you mean to attach it to enum declaration could be emitted for better guidance to the users.

Resolves #69036

@AnthonyLatsis
Copy link
Collaborator

Closed in favor of #69055.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bad diagnostic for generic parameter list on enum case
2 participants