@@ -996,7 +996,6 @@ trait Typers extends Adaptations with Tags with TypersTracking with PatternTyper
996996 if (mode.inPatternMode && isPopulatedPattern)
997997 return tree
998998
999- // TODO (folone): ConstantType folding?
1000999 val tree1 = constfold(tree, pt) // (10) (11)
10011000 if (tree1.tpe <:< pt)
10021001 return adapt(tree1, mode, pt, original)
@@ -1097,7 +1096,7 @@ trait Typers extends Adaptations with Tags with TypersTracking with PatternTyper
10971096 } else tree.tpe match {
10981097 case atp @ AnnotatedType (_, _) if canAdaptAnnotations(tree, this , mode, pt) => // (-1)
10991098 adaptAnnotations(tree, this , mode, pt)
1100- case ct @ ConstantType (value) if mode.inNone(TYPEmode | FUNmode ) && (ct <:< pt) && canAdaptConstantTypeToLiteral && ! ct.isDeclaredSingleton => // (0)
1099+ case ct @ ConstantType (value) if mode.inNone(TYPEmode | FUNmode ) && (ct <:< pt) && canAdaptConstantTypeToLiteral && ! ct.asDeclaredSingleton.isDefined => // (0)
11011100 adaptConstant(value)
11021101 case OverloadedType (pre, alts) if ! mode.inFunMode => // (1)
11031102 inferExprAlternative(tree, pt)
@@ -3479,7 +3478,6 @@ trait Typers extends Adaptations with Tags with TypersTracking with PatternTyper
34793478 ErroneousAnnotation
34803479 }
34813480
3482- // TODO (folone): ConstantType folding?
34833481 /* Calling constfold right here is necessary because some trees (negated
34843482 * floats and literals in particular) are not yet folded.
34853483 */
@@ -3543,7 +3541,6 @@ trait Typers extends Adaptations with Tags with TypersTracking with PatternTyper
35433541 case Typed (t, _) =>
35443542 tree2ConstArg(t, pt)
35453543
3546- // TODO (folone): ConstantType folding?
35473544 case tree =>
35483545 tryConst(tree, pt)
35493546 }
0 commit comments