Skip to content
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

Intersection types do not get promoted to HKT type variables during implicit search #6384

Closed
neko-kai opened this issue Apr 26, 2019 · 0 comments · Fixed by #10071
Closed

Comments

@neko-kai
Copy link
Contributor

Example:

trait Tc1[A]
trait Tc2[A]

class X
object X {
  implicit def catchAll[F[_]]: F[X] = ???
}

type ManualLambda[a] = Tc1[a] & Tc2[a]

object app extends App {
  implicitly[Tc1[X]] //ok
  implicitly[ManualLambda[X]] // ok
  implicitly[Tc1[X] & Tc2[X]] // no implicit argument of type Tc1[X] & Tc2[X] was found for parameter ev of method implicitly in object DottyPredef
}

Expected:
catchAll should make nearly all implicit searches succeed for X (Scala 2 behavior)

Actual:
search for Tc1[X] & Tc2[X] fails with

no implicit argument of type Tc1[X] & Tc2[X] was found for parameter ev of method implicitly in object DottyPredef

Note that catchAll is not mentioned in the error as it was not considered, meanwhile search for ManualLambda succeeds. Seems like dotty doesn't create the equivalent of ManualLambda to fill F parameter currently

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant