You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Error: expected something callable, found an unsigned integer
╭─[input.dada:4:5]
│
4 │ foo()
· ──┬──
· ╰──── here
───╯
Without statement terminators, there are situations where a tail expression has a type but that is not desirable. The obvious solution is to end the block with (), but it parses wrong. Writing { () } does work but is unwieldy.
The text was updated successfully, but these errors were encountered:
Ah, one can also write { } to produce a unit, and the compiler could heuristically suggest it. Still though, this seems like an unfortunate thing to run into.
brson
changed the title
Ambiguity with unit tail expressions
Unexpected parse with unit tail expressions
Feb 8, 2022
I tried to type something like this recently
It results in an unexpected error:
Without statement terminators, there are situations where a tail expression has a type but that is not desirable. The obvious solution is to end the block with
()
, but it parses wrong. Writing{ () }
does work but is unwieldy.The text was updated successfully, but these errors were encountered: