@@ -2398,10 +2398,10 @@ object Types {
2398
2398
2399
2399
override def underlying (implicit ctx : Context ): Type = hi
2400
2400
2401
- /** The non-variant type bounds or alias type with given bounds */
2401
+ /** The non-alias type bounds type with given bounds */
2402
2402
def derivedTypeBounds (lo : Type , hi : Type )(implicit ctx : Context ) =
2403
2403
if ((lo eq this .lo) && (hi eq this .hi) && (variance == 0 )) this
2404
- else TypeBounds .real (lo, hi)
2404
+ else TypeBounds (lo, hi)
2405
2405
2406
2406
/** If this is an alias, a derived alias with the new variance,
2407
2407
* Otherwise the type itself.
@@ -2419,12 +2419,12 @@ object Types {
2419
2419
def & (that : TypeBounds )(implicit ctx : Context ): TypeBounds =
2420
2420
if (this .lo <:< that.lo && that.hi <:< this .hi) that
2421
2421
else if (that.lo <:< this .lo && this .hi <:< that.hi) this
2422
- else TypeBounds .real (this .lo | that.lo, this .hi & that.hi)
2422
+ else TypeBounds (this .lo | that.lo, this .hi & that.hi)
2423
2423
2424
2424
def | (that : TypeBounds )(implicit ctx : Context ): TypeBounds =
2425
2425
if (this .lo <:< that.lo && that.hi <:< this .hi) this
2426
2426
else if (that.lo <:< this .lo && this .hi <:< that.hi) that
2427
- else TypeBounds .real (this .lo & that.lo, this .hi | that.hi)
2427
+ else TypeBounds (this .lo & that.lo, this .hi | that.hi)
2428
2428
2429
2429
override def & (that : Type )(implicit ctx : Context ) = that match {
2430
2430
case that : TypeBounds => this & that
@@ -2481,14 +2481,14 @@ object Types {
2481
2481
}
2482
2482
2483
2483
object TypeBounds {
2484
- def real (lo : Type , hi : Type )(implicit ctx : Context ): TypeBounds =
2484
+ def apply (lo : Type , hi : Type )(implicit ctx : Context ): TypeBounds =
2485
2485
unique(new RealTypeBounds (lo, hi))
2486
2486
def orAlias (lo : Type , hi : Type )(implicit ctx : Context ): TypeBounds =
2487
2487
if (lo eq hi) TypeAlias (lo, 0 )
2488
2488
else unique(new RealTypeBounds (lo, hi))
2489
- def empty (implicit ctx : Context ) = real (defn.NothingType , defn.AnyType )
2490
- def upper (hi : Type )(implicit ctx : Context ) = real (defn.NothingType , hi)
2491
- def lower (lo : Type )(implicit ctx : Context ) = real (lo, defn.AnyType )
2489
+ def empty (implicit ctx : Context ) = apply (defn.NothingType , defn.AnyType )
2490
+ def upper (hi : Type )(implicit ctx : Context ) = apply (defn.NothingType , hi)
2491
+ def lower (lo : Type )(implicit ctx : Context ) = apply (lo, defn.AnyType )
2492
2492
}
2493
2493
2494
2494
object TypeAlias {
0 commit comments