-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Invalid error message on missing given instance #11493
Comments
I wasn't able to reproduce this without the dependency (with fake types for MonadError etc.), so it might have something to do with implicit priority etc. |
This message comes from the |
oh, that would explain why I wasn't getting it to work. I think that behavior of looking up the annotation in parents would be quite confusing if someone didn't know this is happening. And I'm not entirely sure it's helpful if you know 😅 after all, in this case the message is a lie. |
I think there's also a fair argument to be made that the |
Scala 2 does look for
So the questions are:
|
Because existing implicitNotFound messages are designed with this behavior in mind, I think it makes sense to replicate it yes, we can revisit this later. |
There is a suggestion for future linting scala/bug#11653 (comment) I think the idea was to detect whether the parent message applies (type params align). I don't know whether messages are designed with this behavior in mind. It is more of a back-up to report "as much info as possible" when annotations are missing. Lukas suggested warning when the "overriding" annotation is omitted. fthomas/refined#661 (comment) |
I think this makes the most sense. |
Got bit by this again, it's super confusing - any chance we can get this prioritized? |
Compiler version
3.0.0-RC1
Minimized code
https://github.com/kubukoz/given-repro
Output
Expectation
Something along the lines of
Could not find an instance of MonadError[[a] =>> F[a], Failure] for cats.effect.IO
More context
The typeclass hierarchy is:
MonadError[F[_], E] <: Monad[F]
. Cats IO hasMonadError[IO, Throwable]
, soMonad[IO]
is definitely there.The text was updated successfully, but these errors were encountered: