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

Naming error when tuple result on lambda has no parens #335

Open
reinux opened this issue Apr 16, 2020 · 0 comments
Open

Naming error when tuple result on lambda has no parens #335

reinux opened this issue Apr 16, 2020 · 0 comments

Comments

@reinux
Copy link

reinux commented Apr 16, 2020

This might be a mistake that's unique to people coming from OCaml/F#, but:

tasks |> List.map (\t -> t.id, t)

The mistake was in forgetting the brackets on the result tuple (F# doesn't require commas around tuples, as it uses semicolons for list comprehensions instead).

The error I get:

NAMING ERROR - I cannot find a `t` variable:
191|         |> List.map (\t -> t.id, t)
                                      ^

I'm not sure this would be easy to improve, since it can't be helped that the -> operator has higher precedence than ,.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant