diff --git a/tests/pos/so68877939.scala b/tests/pos/so68877939.scala new file mode 100644 index 000000000000..41c5ee8ac659 --- /dev/null +++ b/tests/pos/so68877939.scala @@ -0,0 +1,15 @@ +abstract class Quantity[A <: Quantity[A]] +sealed trait UnitOfMeasure[A <: Quantity[A]] + +class Time extends Quantity[Time] +object Minutes extends UnitOfMeasure[Time] + +class PowerRamp extends Quantity[PowerRamp] +object KilowattsPerHour extends UnitOfMeasure[PowerRamp] + +type Test[X <: UnitOfMeasure[?]] = X match + case UnitOfMeasure[t] => t + +@main def main = + summon[Test[Minutes.type] =:= Time] + summon[Test[KilowattsPerHour.type] =:= PowerRamp]