@@ -142,9 +142,12 @@ object Types {
142
142
/** Is this type a value type? */
143
143
final def isValueType : Boolean = this .isInstanceOf [ValueType ]
144
144
145
- /** Is the is value type or type lambda? */
145
+ /** Is this a value type or a type lambda? */
146
146
final def isValueTypeOrLambda : Boolean = isValueType || this .isInstanceOf [TypeLambda ]
147
147
148
+ /** Is this a value type or a wildcard? */
149
+ final def isValueTypeOrWildcard : Boolean = isValueType || this .isInstanceOf [WildcardType ]
150
+
148
151
/** Does this type denote a stable reference (i.e. singleton type)? */
149
152
final def isStable (implicit ctx : Context ): Boolean = stripTypeVar match {
150
153
case tp : TermRef => tp.termSymbol.isStable && tp.prefix.isStable || tp.info.isStable
@@ -1524,11 +1527,8 @@ object Types {
1524
1527
/** A marker trait for types that can be types of values or prototypes of value types */
1525
1528
trait ValueTypeOrProto extends TermType
1526
1529
1527
- /** A marker trait for types that can be types of values or wildcards */
1528
- trait ValueTypeOrWildcard extends TermType
1529
-
1530
1530
/** A marker trait for types that can be types of values or that are higher-kinded */
1531
- trait ValueType extends ValueTypeOrProto with ValueTypeOrWildcard
1531
+ trait ValueType extends ValueTypeOrProto
1532
1532
1533
1533
/** A marker trait for types that are guaranteed to contain only a
1534
1534
* single non-null value (they might contain null in addition).
@@ -2480,8 +2480,8 @@ object Types {
2480
2480
2481
2481
object AndType {
2482
2482
def apply (tp1 : Type , tp2 : Type )(implicit ctx : Context ): AndType = {
2483
- assert(tp1.isInstanceOf [ ValueTypeOrWildcard ] &&
2484
- tp2.isInstanceOf [ ValueTypeOrWildcard ] , i " $tp1 & $tp2 / " + s " $tp1 & $tp2" )
2483
+ assert(tp1.isValueTypeOrWildcard &&
2484
+ tp2.isValueTypeOrWildcard , i " $tp1 & $tp2 / " + s " $tp1 & $tp2" )
2485
2485
unchecked(tp1, tp2)
2486
2486
}
2487
2487
@@ -2525,8 +2525,8 @@ object Types {
2525
2525
myBaseClasses
2526
2526
}
2527
2527
2528
- assert(tp1.isInstanceOf [ ValueTypeOrWildcard ] &&
2529
- tp2.isInstanceOf [ ValueTypeOrWildcard ] , s " $tp1 $tp2" )
2528
+ assert(tp1.isValueTypeOrWildcard &&
2529
+ tp2.isValueTypeOrWildcard , s " $tp1 $tp2" )
2530
2530
2531
2531
private [this ] var myJoin : Type = _
2532
2532
private [this ] var myJoinPeriod : Period = Nowhere
@@ -3757,7 +3757,7 @@ object Types {
3757
3757
object TryDynamicCallType extends FlexType
3758
3758
3759
3759
/** Wildcard type, possibly with bounds */
3760
- abstract case class WildcardType (optBounds : Type ) extends CachedGroundType with ValueTypeOrWildcard {
3760
+ abstract case class WildcardType (optBounds : Type ) extends CachedGroundType with TermType {
3761
3761
def derivedWildcardType (optBounds : Type )(implicit ctx : Context ) =
3762
3762
if (optBounds eq this .optBounds) this
3763
3763
else if (! optBounds.exists) WildcardType
0 commit comments