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
# This works as expectedfunc1 = \val ->
when val isA x | B x -> x
C -> {}
# This works as expectedfunc2 = \val ->
when val isA { x } | B x -> x
C -> {}
# This works as expectedfunc3 = \val ->
when val isA { x: x } | B { x: x } -> x
C -> {}
# This causes a duplicate name errorfunc4 = \val ->
when val isA { x } | B { x } -> x
C -> {}
── DUPLICATE NAME in Model.roc ─────────────────────────────────────────────────
The x name is first defined here:
151│ A { x } | B { x } -> x
^^^^^
But then it's defined a second time here:
151│ A { x } | B { x } -> x
^^^^^
Since these variables have the same name, it's easy to use the wrong
one by accident. Give one of them a new name.
── NAME NOT BOUND IN ALL PATTERNS in Model.roc ─────────────────────────────────
x is not bound in all patterns of this when branch
151│ A { x } | B { x } -> x
^
Identifiers introduced in a when branch must be bound in all patterns
of the branch. Otherwise, the program would crash when it tries to use
an identifier that wasn't bound!
────────────────────────────────────────────────────────────────────────────────
2 errors and 0 warnings found in 15 ms
The text was updated successfully, but these errors were encountered:
The text was updated successfully, but these errors were encountered: