-
Notifications
You must be signed in to change notification settings - Fork 21
Intersection type implicit can't be found when obscured by a type parameter #11502
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
I was going to change the title to say "compound type" but with actual intersection types in Dotty the problem still exists. In fact, it is worse in Dotty. Only
Making /cc @smarter |
Please open an issue in the Dotty tracker |
@smarter I opened dotty-related issues for this: |
scala> X.tc12: Tc1[X] with Tc2[X]
^
error: polymorphic expression cannot be instantiated to expected type;
found : [F[x] >: Tc12[x]]F[X]
required: Tc1[X] with Tc2[X]
scala> typeOf[Tc1[X] with Tc2[X]].typeSymbol.typeParams
res20: List[$r.intp.global.Symbol] = List() |
LoL, this is an artefact of how subtyping checks are ordered:
So when we have |
Example:
Note, changing the return type of X's instance to
F[X] with F[X]
or applying an identity type lambda magically works around the issue, even though both transformations are tautological:The text was updated successfully, but these errors were encountered: