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

`in` doesn't work inside of `case` or `|` guards of implicit `for..in` loops #1039

Closed
pepkin88 opened this Issue Apr 1, 2018 · 0 comments

Comments

Projects
None yet
2 participants
@pepkin88
Contributor

pepkin88 commented Apr 1, 2018

Examples causing a compilation error:

for arr case .. in [1 2] => 1
for arr | v in b => 1
[1 for arr case .. in [1 2]]

Working examples:

for arr case (.. in [1 2]) => 1
for arr when .. in [1 2] => 1
for n in a case n in [1 2] => 1
for til 3 | .. in b => 1

It seems that affected are only implicit for..in loops (for array) with guards with the in keyword inside and only when using case or | as a guard keyword, not when. Wrapping the guard's condition with parentheses also mitigates the issue.

Possibly related to #923 (#925).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment