mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-01 15:51:12 +00:00
improved phantom type message
This commit is contained in:
parent
7e4a1ef4bd
commit
c42b5a1e5b
2 changed files with 10 additions and 2 deletions
|
@ -425,7 +425,12 @@ pub fn can_problem<'b>(
|
|||
alloc.reflow(" alias definition:"),
|
||||
]),
|
||||
alloc.region(variable_region),
|
||||
alloc.reflow("Roc does not allow phantom type parameters!"),
|
||||
alloc.reflow("Roc does not allow unused type parameters!"),
|
||||
// TODO add link to this guide section
|
||||
alloc.hint().append(alloc.reflow(
|
||||
"If you want an unused type parameter (a so-called \"phantom type\"), \
|
||||
read the guide section on phantom data.",
|
||||
)),
|
||||
]),
|
||||
Problem::DuplicateRecordFieldValue {
|
||||
field_name,
|
||||
|
|
|
@ -2663,7 +2663,10 @@ mod test_reporting {
|
|||
1 ┆ Foo a : [ Foo ]
|
||||
┆ ^
|
||||
|
||||
Roc does not allow phantom type parameters!
|
||||
Roc does not allow unused type parameters!
|
||||
|
||||
Hint: If you want an unused type parameter (a so-called "phantom
|
||||
type"), read the guide section on phantom data.
|
||||
"#
|
||||
),
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue