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
inlinevalmsg:String="abc"traitE[T]
deff(using@annotation.implicitNotFound(msg) e: E[Int]):Unit= ()
@main defhello():Unit= f
Output
[error] -- [E172] TypeError:Main.scala:5:27
[error] 5|@main defhello():Unit= f
[error] |^
[error] |Nogiveninstance of typeE[Int] was found for parameter e of method f
Expectation
The error No given instance of type E[Int] was found for parameter e of method f is the default one that was supposed to be customized to abc. The reason this happens is the : String type annotation.
If you just do inline val msg = "abc" then it will work as expected: