Closed
Description
object App {
case class Box[F[_]](value: F[Int])
sealed trait IsK[F[_], G[_]]
final case class ReflK[F[_]]() extends IsK[F, F]
def foo[F[_], G[_]](r: F IsK G, a: Box[F]): Box[G] = r match { case ReflK() => a }
def main(args: Array[String]): Unit = {
println(foo(ReflK(), Box(Option(10))))
}
}
-- [E007] Type Mismatch Error: foo.scala:6:81 ----------------------------------
6 | def foo[F[_], G[_]](r: F IsK G, a: Box[F]): Box[G] = r match { case ReflK() => a }
| ^
| found: App.Box[F](a)
| required: App.Box[G]
|
| where: F is a type in method foo with bounds <: G[_]
| G is a type in method foo with bounds <: F[_]
one error found
Metadata
Metadata
Assignees
Labels
No labels