mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-03 19:58:18 +00:00
Revise errors for undeclared type vars in aliases
This commit is contained in:
parent
e5ea6dc461
commit
8357bd8c91
4 changed files with 207 additions and 39 deletions
|
@ -8651,6 +8651,29 @@ In roc, functions are always written as a lambda, like{}
|
|||
"
|
||||
);
|
||||
|
||||
test_report!(
|
||||
underscore_in_alias,
|
||||
indoc!(
|
||||
r"
|
||||
I : Num.Int _
|
||||
a : I
|
||||
a = 0x5
|
||||
a
|
||||
"
|
||||
),
|
||||
@r"
|
||||
── UNBOUND TYPE VARIABLE in /code/proj/Main.roc ────────────────────────────────
|
||||
|
||||
The definition of `I` has an unbound type variable:
|
||||
|
||||
4│ I : Num.Int _
|
||||
^
|
||||
|
||||
Tip: Type variables must be bound before the `:`. Perhaps you intended
|
||||
to add a type parameter to this type?
|
||||
"
|
||||
);
|
||||
|
||||
test_report!(
|
||||
wildcard_in_opaque,
|
||||
indoc!(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue