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
Order of implicits in file matters; could we at least fix this for implicit objects? #8697
Comments
Imported From: https://issues.scala-lang.org/browse/SI-8697?orig=1 |
@retronym said: Implicit search will never force inference of an implicit down lower in the same file as the implicit call site. This avoids spurious cycles in inference. Dotty, Martin's current research compiler, actually requires implicits to have explicit return types. IIRC, he does allow implicit objects. I'm not sure how he avoids the potential cycles. I'll use this ticket as a reminder to dig into his approach and see if we can backport the treatment of implicit objects to Scala 2.12. You can use explicitly type annotated implicit lazy vals as a more reliable tool. |
@puffnfresh said: |
@SethTisue said: |
The following works:
While the the following can not find the implicit T[C] instance:
The only difference is the order of appearance for the B and C objects.
The text was updated successfully, but these errors were encountered: