diff options
Diffstat (limited to 'tests/run/t3097.scala')
-rw-r--r-- | tests/run/t3097.scala | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/run/t3097.scala b/tests/run/t3097.scala new file mode 100644 index 000000000..c5bac528b --- /dev/null +++ b/tests/run/t3097.scala @@ -0,0 +1,18 @@ +sealed trait ISimpleValue + +sealed trait IListValue extends ISimpleValue +sealed trait IAtomicValue[O] extends ISimpleValue + +sealed trait IAbstractDoubleValue[O] extends IAtomicValue[O] +sealed trait IDoubleValue extends IAbstractDoubleValue[Double] + +case class ListValue(val items: List[IAtomicValue[_]]) extends IListValue +class DoubleValue(val data: Double) extends IDoubleValue + +object Test extends dotty.runtime.LegacyApp { + // match is exhaustive + (new DoubleValue(1): ISimpleValue) match { + case m: IListValue => println("list") + case a: IAtomicValue[_] => println("atomic") + } +} |