File tree 2 files changed +26
-0
lines changed
compiler/src/dotty/tools/dotc/core
2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -2902,6 +2902,8 @@ class TypeComparer(@constructorOnly initctx: Context) extends ConstraintHandling
2902
2902
tp
2903
2903
case tp : ConstantType =>
2904
2904
tp
2905
+ case tp : AppliedType if tp.tryCompiletimeConstantFold.exists =>
2906
+ tp.tryCompiletimeConstantFold
2905
2907
case tp : HKTypeLambda =>
2906
2908
tp
2907
2909
case tp : ParamRef =>
Original file line number Diff line number Diff line change
1
+ import scala .compiletime .ops .int .*
2
+
3
+ // NOTE ops.int.S is documented as equivalent to MyS
4
+
5
+ type MyS [X ] = X match
6
+ case 0 => 1
7
+ case 1 => 2
8
+ case 2 => 3
9
+
10
+ type M [I <: Int ] = 4 match
11
+ case 1 - 1 => " 0"
12
+ case MyS [I ] => " 2"
13
+ case S [I ] => " 2" // Not provablyDisjoint before changes
14
+ case 2 + I => " 3"
15
+ case I + 3 => " 4"
16
+
17
+ val _: M [1 ] = " 4"
18
+
19
+
20
+ type M2 [I <: Int , P ] = I match
21
+ case P => " b"
22
+ case _ => " c"
23
+
24
+ val _: M2 [5 , 2 + 3 ] = " b"
You can’t perform that action at this time.
0 commit comments