File tree 1 file changed +4
-4
lines changed
compiler/src/dotty/tools/dotc/core
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -3780,22 +3780,22 @@ object Types {
3780
3780
3781
3781
def tryCompiletimeConstantFold (implicit ctx : Context ): Type = tycon match {
3782
3782
case tycon : TypeRef if defn.isCompiletimeAppliedType(tycon.symbol) =>
3783
- def constValue (tp : Type ): Option [Any ] = tp match {
3783
+ def constValue (tp : Type ): Option [Any ] = tp.dealias match {
3784
3784
case ConstantType (Constant (n)) => Some (n)
3785
3785
case _ => None
3786
3786
}
3787
3787
3788
- def boolValue (tp : Type ): Option [Boolean ] = tp match {
3788
+ def boolValue (tp : Type ): Option [Boolean ] = tp.dealias match {
3789
3789
case ConstantType (Constant (n : Boolean )) => Some (n)
3790
3790
case _ => None
3791
3791
}
3792
3792
3793
- def intValue (tp : Type ): Option [Int ] = tp match {
3793
+ def intValue (tp : Type ): Option [Int ] = tp.dealias match {
3794
3794
case ConstantType (Constant (n : Int )) => Some (n)
3795
3795
case _ => None
3796
3796
}
3797
3797
3798
- def stringValue (tp : Type ): Option [String ] = tp match {
3798
+ def stringValue (tp : Type ): Option [String ] = tp.dealias match {
3799
3799
case ConstantType (Constant (n : String )) => Some (n)
3800
3800
case _ => None
3801
3801
}
You can’t perform that action at this time.
0 commit comments