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
When using the annotation from a supertype, include the name of the required type in the error message.
Also,
scala> @annotation.implicitNotFound("Need one for ${A}")
| trait T[A] ; trait U extends T[Int] ; implicitly[U] ; implicitly[T[String]]
trait T[A] ; trait U extends T[Int] ; implicitly[U] ; implicitly[T[String]]
^
On line 2: error: Need one for
trait T[A] ; trait U extends T[Int] ; implicitly[U] ; implicitly[T[String]]
^
On line 2: error: Need one for String
The text was updated successfully, but these errors were encountered:
Lukas's good suggestion to refcheck if an annotation is missing was a bit too much work, but in future it could be enabled under Xlint:implicitNotFound.
Maybe the message change here can also be tweaked. It would be nice if the intersobralator accepted ${this} for the required type. It's not obvious that type args are helpful unless they match, so there are reasons not to include the annotation. I don't remember the original use case.
In future, warn if omitting the custom message because it intersobralates type args that don't match.
When using the annotation from a supertype, include the name of the required type in the error message.
Also,
The text was updated successfully, but these errors were encountered: