@@ -3863,14 +3863,6 @@ object Types {
3863
3863
def apply (tp : Type ) = tp
3864
3864
}
3865
3865
3866
- case class Range (lo : Type , hi : Type ) extends UncachedGroundType {
3867
- assert(! lo.isInstanceOf [Range ])
3868
- assert(! hi.isInstanceOf [Range ])
3869
-
3870
- override def toText (printer : Printer ): Text =
3871
- lo.toText(printer) ~ " .." ~ hi.toText(printer)
3872
- }
3873
-
3874
3866
/** A type map that approximates TypeBounds types depending on
3875
3867
* variance.
3876
3868
*
@@ -3995,9 +3987,11 @@ object Types {
3995
3987
case Range (lo, hi) :: args1 =>
3996
3988
val v = tparams.head.paramVariance
3997
3989
if (v == 0 ) false
3998
- else if (v > 0 ) { loBuf += lo; hiBuf += hi }
3999
- else { loBuf += hi; hiBuf += lo }
4000
- distributeArgs(args1, tparams.tail)
3990
+ else {
3991
+ if (v > 0 ) { loBuf += lo; hiBuf += hi }
3992
+ else { loBuf += hi; hiBuf += lo }
3993
+ distributeArgs(args1, tparams.tail)
3994
+ }
4001
3995
case arg :: args1 =>
4002
3996
loBuf += arg; hiBuf += arg
4003
3997
distributeArgs(args1, tparams.tail)
@@ -4047,6 +4041,17 @@ object Types {
4047
4041
protected def reapply (tp : Type ): Type = apply(tp)
4048
4042
}
4049
4043
4044
+ /** A range of possible types between lower bound `lo` and upper bound `hi`.
4045
+ * Only used internally in `ApproximatingTypeMap`.
4046
+ */
4047
+ private case class Range (lo : Type , hi : Type ) extends UncachedGroundType {
4048
+ assert(! lo.isInstanceOf [Range ])
4049
+ assert(! hi.isInstanceOf [Range ])
4050
+
4051
+ override def toText (printer : Printer ): Text =
4052
+ lo.toText(printer) ~ " .." ~ hi.toText(printer)
4053
+ }
4054
+
4050
4055
// ----- TypeAccumulators ----------------------------------------------------
4051
4056
4052
4057
abstract class TypeAccumulator [T ](implicit protected val ctx : Context ) extends ((T , Type ) => T ) {
0 commit comments