docs/_docs/reference/error-codes/E158.md
This warning occurs when an @implicitNotFound annotation references a type variable that doesn't exist in the scope of the annotated type.
The @implicitNotFound annotation allows customizing the error message when an implicit value cannot be found. It can interpolate type parameters using ${TypeParam} syntax, but the referenced type parameter must be defined by the annotated trait, class, or method.
@annotation.implicitNotFound("Missing ${X}")
trait Show[T]
-- [E158] Reference Warning: example.scala:1:40 --------------------------------
1 |@annotation.implicitNotFound("Missing ${X}")
| ^
|Invalid reference to a type variable `X` found in the annotation argument.
|The variable does not occur as a parameter in the scope of type `Show`.
// Reference the actual type parameter T
@annotation.implicitNotFound("No Show instance found for ${T}")
trait Show[T]