Open TomasMikula opened 22 hours ago
3.5.0 3.6.1
enum Foo[T <: AnyKind]: case Bar extends Foo[List] case Baz extends Foo[Map]
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
It should compile, like this equivalent sealed family:
sealed
// compiles sealed trait Foo[T <: AnyKind] case object Bar extends Foo[List] case object Baz extends Foo[Map]
Compiler version
3.5.0 3.6.1
Minimized code
Output
https://scastie.scala-lang.org/A8kJXNH1QMSMPOQe6DmCJg
Expectation
It should compile, like this equivalent
sealed
family: