Skip to content

Added more helpful syntax error for enum member commas#33336

Merged
orta merged 3 commits into
microsoft:masterfrom
JoshuaKGoldberg:enum-syntax-error-specifics
Sep 11, 2019
Merged

Added more helpful syntax error for enum member commas#33336
orta merged 3 commits into
microsoft:masterfrom
JoshuaKGoldberg:enum-syntax-error-specifics

Conversation

@JoshuaKGoldberg
Copy link
Copy Markdown
Contributor

Switches the error message emitted by the parser to the more specific "An enum member name must be followed by a ',' or '='." when the expected comma doesn't follow the member.

Fixes #838.

Josh Goldberg added 2 commits September 9, 2019 22:11
Switches the error message emitted by the parser to the more specific _"An enum member name must be followed by a ',' or '='."_ when the expected comma doesn't follow the member.
@JoshuaKGoldberg JoshuaKGoldberg marked this pull request as ready for review September 10, 2019 02:50
Copy link
Copy Markdown
Contributor

@orta orta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love the idea 👍

Comment thread src/compiler/diagnosticMessages.json Outdated
@orta
Copy link
Copy Markdown
Contributor

orta commented Sep 11, 2019

Cool, yep - every message I can think of around this tends to be a lot more verbose and in-direct. I think this is good enough for now 👍

@orta orta merged commit f9cc374 into microsoft:master Sep 11, 2019
@JoshuaKGoldberg JoshuaKGoldberg deleted the enum-syntax-error-specifics branch September 11, 2019 21:07
@microsoft microsoft locked as resolved and limited conversation to collaborators Oct 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

More helpful error message for mistakenly using : instead of = in Enum

2 participants