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: Unknown variable
┌─ /src/main.gleam:4:7
│
4 │ let X = 2
│ ^
The name `X` is not in scope here.
error: Unknown variable
┌─ /src/main.gleam:5:12
│
5 │ io.debug(X)
│ ^
The name `X` is not in scope here.
Maybe this error message could be improved so that it's clear that here the user tried to pattern match on a constructor which does not exsits.
Danielle — 11:09
Yeah that is a slightly confusing error message to me
lpil — 11:09
What you’ve written is valid Gleam
You’re pattern matching on a custom type constructor called X, but no such constructor is in scope
We couldn’t change the error message for this niche situation without making the error message for common situation worse
Danielle — 11:11
does it saying error: Unknown variable make the most sense considering it's a pattern match?
lpil — 11:12
Unknown constructor might be clearer
Unknown value?
bouzlibop — 11:14
"You’re pattern matching on a custom type constructor called X" would be a super helpful error message 🙂
lpil — 11:14
Could you make an issue with the above conversation please
bouzlibop — 11:14
Sure 👍
lpil — 11:17
Thank you
The text was updated successfully, but these errors were encountered:
Context
When trying to run following:
in the playground
One gets:
Maybe this error message could be improved so that it's clear that here the user tried to pattern match on a constructor which does not exsits.
Notes
This issue was discussed on the Discord server:
The text was updated successfully, but these errors were encountered: