diff --git a/compiler/reporting/src/report.rs b/compiler/reporting/src/report.rs index 89331eb685..2df5637ceb 100644 --- a/compiler/reporting/src/report.rs +++ b/compiler/reporting/src/report.rs @@ -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, diff --git a/compiler/reporting/tests/test_reporting.rs b/compiler/reporting/tests/test_reporting.rs index 76abd42a60..c9823edb3d 100644 --- a/compiler/reporting/tests/test_reporting.rs +++ b/compiler/reporting/tests/test_reporting.rs @@ -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. "# ), )