File tree 2 files changed +7
-2
lines changed 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -2145,7 +2145,12 @@ object Types {
2145
2145
unique(new CachedAndType (tp1, tp2))
2146
2146
}
2147
2147
def make (tp1 : Type , tp2 : Type )(implicit ctx : Context ): Type =
2148
- if (tp1 eq tp2) tp1 else apply(tp1, tp2)
2148
+ if ((tp1 eq tp2) || (tp2 eq defn.AnyType ))
2149
+ tp1
2150
+ else if (tp1 eq defn.AnyType )
2151
+ tp2
2152
+ else
2153
+ apply(tp1, tp2)
2149
2154
}
2150
2155
2151
2156
abstract case class OrType (tp1 : Type , tp2 : Type ) extends CachedGroundType with AndOrType {
Original file line number Diff line number Diff line change @@ -287,7 +287,7 @@ trait ImplicitRunInfo { self: RunInfo =>
287
287
case tp : TypeRef if tp.symbol.isAbstractOrAliasType =>
288
288
val pre = tp.prefix
289
289
def joinClass (tp : Type , cls : ClassSymbol ) =
290
- AndType (tp, cls.typeRef.asSeenFrom(pre, cls.owner))
290
+ AndType .make (tp, cls.typeRef.asSeenFrom(pre, cls.owner))
291
291
val lead = if (tp.prefix eq NoPrefix ) defn.AnyType else apply(tp.prefix)
292
292
(lead /: tp.classSymbols)(joinClass)
293
293
case tp : TypeVar =>
You can’t perform that action at this time.
0 commit comments