Skip to content

Constraint solving of higher-kinded type variables is too coarse #4147

Closed
@joroKr21

Description

@joroKr21

Straight out of scala/bug#10753 (comment)

trait Bar[F[_]]
trait Foo[A]
trait Qux[A] extends Foo[A]
object Qux {
  implicit def string: Qux[String] = ???
  implicit def bar: Bar[Qux] = ???
}

case class Problem[A](a: A)
object Problem {
  import Qux._
  implicit def deriv[A, F[_]](implicit B: Bar[F], F: F[A]): F[Problem[A]] = ???
  implicitly[Foo[Problem[String]]]
}

I don't know if this is the intended behaviour in Dotty, but I'm reporting it just in case. It looks like F is instantiated to Foo in Dotty but not in Scala, which is what scala/bug#10753 is all about. The code above is a counterexample (maybe it can be minimized further).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions