Skip to content

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

@pepkin88

Description

@pepkin88

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).

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions