We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents b94160b + e546f07 commit 472c047Copy full SHA for 472c047
tests/pos/so68877939.scala
@@ -0,0 +1,15 @@
1
+abstract class Quantity[A <: Quantity[A]]
2
+sealed trait UnitOfMeasure[A <: Quantity[A]]
3
+
4
+class Time extends Quantity[Time]
5
+object Minutes extends UnitOfMeasure[Time]
6
7
+class PowerRamp extends Quantity[PowerRamp]
8
+object KilowattsPerHour extends UnitOfMeasure[PowerRamp]
9
10
+type Test[X <: UnitOfMeasure[?]] = X match
11
+ case UnitOfMeasure[t] => t
12
13
+@main def main =
14
+ summon[Test[Minutes.type] =:= Time]
15
+ summon[Test[KilowattsPerHour.type] =:= PowerRamp]
0 commit comments