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

Fix parser identifies call with named args as var #10842

Conversation

straight-shoota
Copy link
Member

@straight-shoota straight-shoota commented Jun 22, 2021

A call is incorrectly identified as reading from a local variable if such exists, even with a named argument (and no parenthesis, block, etc.).

The following code is a minimal reproduction:

foo = 1
foo b: 1

Closes #10693

The code can be refactored and more simplified (the big conditional). But I'll leave that for a follow-up (#10843) to focus on the bug fix here.

@straight-shoota straight-shoota added kind:bug A bug in the code. Does not apply to documentation, specs, etc. topic:compiler:parser labels Jun 22, 2021
@straight-shoota straight-shoota added this to the 1.1.0 milestone Jul 6, 2021
@straight-shoota straight-shoota merged commit 27dea13 into crystal-lang:master Jul 8, 2021
@straight-shoota straight-shoota deleted the fix/parse-named-arguments branch July 8, 2021 12:05
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.

Formatter bug: expecting ), not 'IDENT, bar'
2 participants