Skip to content
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

Reject hash literals with mixed syntax #11154

Merged
merged 1 commit into from
Sep 9, 2021

Conversation

makenowjust
Copy link
Contributor

@makenowjust makenowjust commented Sep 1, 2021

Fix #11074

The parser rejects a hash literal like {"foo" => 1, "bar": 2} now. Notice that {"bar": 1, "foo" => 2} is already a syntax error.

@straight-shoota straight-shoota added kind:bug A bug in the code. Does not apply to documentation, specs, etc. topic:tools:formatter labels Sep 1, 2021
@makenowjust makenowjust changed the title Reject a hash literal having both of 'key => value' and 'key: value' entry Reject a hash literal having both of 'key => value' and 'key: value' entries Sep 1, 2021
Copy link
Member

@sdogruyol sdogruyol left a comment

Choose a reason for hiding this comment

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

Thank you @makenowjust 🙏

@straight-shoota straight-shoota added this to the 1.2.0 milestone Sep 8, 2021
@straight-shoota straight-shoota changed the title Reject a hash literal having both of 'key => value' and 'key: value' entries Reject hash literals with mixed syntax Sep 9, 2021
@straight-shoota straight-shoota merged commit 9d40e54 into crystal-lang:master Sep 9, 2021
@makenowjust makenowjust deleted the fix-11074 branch September 9, 2021 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:bug A bug in the code. Does not apply to documentation, specs, etc. topic:compiler:parser
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Parser accepts hybrid of named tuple and hash literals
3 participants