-
Notifications
You must be signed in to change notification settings - Fork 20
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
RequireMsg compile-time error message escaping code context #234
Comments
This could be due to the caching mechanism in singleton-ops. |
you are most likely right, there is no difference in shapeless code. In the meantime I'll try to PR a piece of unit test first. |
Actually this kind of looks like a Scalac bug, but maybe as a result of that tampering with |
@soronpo It turns out that the error is only triggered in certain cases. Please see the new test case in my PR |
I'm now 90% sure it wasn't. By observing what is being annotated by your code: After logging the
I observe the following message in compile-time:
Clearly, the annotation of "Set" was changed, which even without caching, affects all other implicits with "Set[*]" return type. To solve this, you'll have 3 options:
Not sure if this information is helpful |
... Sorry the last option is out of context & doesn't apply to your case. The implicit error will always write over the previous error |
This is a short code snippet that demonstrates the problem:
error message:
The second implicit error message got corrupted by the first.
if you delete the first implicit line
implicitly[Set[Foo3.FF[HasM]]]
, the error message goes back to normal:I vaguely remember that RequireMsg macro overwrites @ImplicitNotFound annotation to achieve its purpose, and this implementation is derived from shapeless. So I guess the easiest way for me is to try the following solution:
The text was updated successfully, but these errors were encountered: