Open
Description
Compiler version
3.2.2
Minimized code
class Test[F[_]] {
sealed trait Foo[A, B]
// note that Foo's B param maps directly to U (i.e. no GADT involved on this type param)
case class Bar[T, U]() extends Foo[F[T], U] {
def get: Option[U] = None
}
def go[T, U](that: Foo[F[T], U]): Option[U] =
that match
case b: Bar[t, u] =>
summon[U =:= u] // Error: Cannot prove that U =:= u.
b.get // Error: Found: Option[u], Required: Option[U]
}
Output
Compilation fails, see the errors in the comments.
Expectation
The code should compile.