-
Notifications
You must be signed in to change notification settings - Fork 1.1k
@implicitNotFound string interpolator doesn't work with types #7092
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
We should also support this: @implicitNotFound("Not found for ${A} and ${B}")
type F = [A] =>> [B] =>> Any Maybe substitute placeholders if the type lambda is partially applied: @implicitNotFound("Not found for ${A}, ${B}")
type F = [A] =>> [B] =>> (A, B)
@main def Main = {
the[F[Int]] // Not found for Int, <unbound>
} |
In the meantime the observed behavior changed. The first error is not For completeness: it also does not work on opaque types which came as a surprise to me: import scala.annotation.implicitNotFound
object bugreport {
@implicitNotFound("Could not find ${A}")
opaque type F[A] = A
}
def foo = summon[bugreport.F[Int]] |
@b-studios am I right that |
Actually, I am not sure about this. It sounds like it would be easier to forbid them, but if I search for a type before dealising and it has an annotation, then in general it should be possible to report it for this case. I wouldn't use the annotation for the right-hand side, though. |
Well, currently when you have
then for |
I think it makes sense to support at least abstract type members (which have not been aliased yet). |
No sure about difficulty here, but I just got an example where it's really useful to have
While without it compilation message is quite cryptic about missing given. So I don't think annotation should be forbidden 🤔 |
Hmm, in Scala 3.3.1 it doesn't work at all for type aliases with a type parameter. It does work for simple type aliases. |
Out:
The text was updated successfully, but these errors were encountered: