Open
Description
Compiler version
3.5.0
3.6.1
Minimized code
enum Foo[T <: AnyKind]:
case Bar extends Foo[List]
case Baz extends Foo[Map]
Output
Found: (Playground.Foo.Bar : Playground.Foo[List]) |
(Playground.Foo.Baz : Playground.Foo[Map])
Required: Playground.Foo[? >: List[?] & Map[?, ?] <: List[?] | Map[?, ?]]
https://scastie.scala-lang.org/A8kJXNH1QMSMPOQe6DmCJg
Expectation
It should compile, like this equivalent sealed
family:
// compiles
sealed trait Foo[T <: AnyKind]
case object Bar extends Foo[List]
case object Baz extends Foo[Map]