@@ -142,9 +142,12 @@ object Types {
142142 /** Is this type a value type? */
143143 final def isValueType : Boolean = this .isInstanceOf [ValueType ]
144144
145- /** Is the is value type or type lambda? */
145+ /** Is this a value type or a type lambda? */
146146 final def isValueTypeOrLambda : Boolean = isValueType || this .isInstanceOf [TypeLambda ]
147147
148+ /** Is this a value type or a wildcard? */
149+ final def isValueTypeOrWildcard : Boolean = isValueType || this .isInstanceOf [WildcardType ]
150+
148151 /** Does this type denote a stable reference (i.e. singleton type)? */
149152 final def isStable (implicit ctx : Context ): Boolean = stripTypeVar match {
150153 case tp : TermRef => tp.termSymbol.isStable && tp.prefix.isStable || tp.info.isStable
@@ -1524,11 +1527,8 @@ object Types {
15241527 /** A marker trait for types that can be types of values or prototypes of value types */
15251528 trait ValueTypeOrProto extends TermType
15261529
1527- /** A marker trait for types that can be types of values or wildcards */
1528- trait ValueTypeOrWildcard extends TermType
1529-
15301530 /** 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
15321532
15331533 /** A marker trait for types that are guaranteed to contain only a
15341534 * single non-null value (they might contain null in addition).
@@ -2480,8 +2480,8 @@ object Types {
24802480
24812481 object AndType {
24822482 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" )
24852485 unchecked(tp1, tp2)
24862486 }
24872487
@@ -2525,8 +2525,8 @@ object Types {
25252525 myBaseClasses
25262526 }
25272527
2528- assert(tp1.isInstanceOf [ ValueTypeOrWildcard ] &&
2529- tp2.isInstanceOf [ ValueTypeOrWildcard ] , s " $tp1 $tp2" )
2528+ assert(tp1.isValueTypeOrWildcard &&
2529+ tp2.isValueTypeOrWildcard , s " $tp1 $tp2" )
25302530
25312531 private [this ] var myJoin : Type = _
25322532 private [this ] var myJoinPeriod : Period = Nowhere
@@ -3757,7 +3757,7 @@ object Types {
37573757 object TryDynamicCallType extends FlexType
37583758
37593759 /** 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 {
37613761 def derivedWildcardType (optBounds : Type )(implicit ctx : Context ) =
37623762 if (optBounds eq this .optBounds) this
37633763 else if (! optBounds.exists) WildcardType
0 commit comments