Open
Description
Compiler version
scala 3.7.1
Minimized code
class Module {
type BarTy
sealed trait Adt[A]
case class Foo() extends Adt[String]
case class Bar[A <: BarTy](x: BarTy) extends Adt[A]
}
object Basic extends Module {
type BarTy = String
}
def test(a: Basic.Adt[String]) = {
a match
case Basic.Foo() =>
}
val result = test(Basic.Bar(""))
print(result)
Output
Exception in thread "main" scala.MatchError: Bar()
Expectation
Compiler warning: match may not be exhaustive.