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