@@ -4198,13 +4198,6 @@ object Types {
4198
4198
val tp1 = tp.prefix.lookupRefined(tp.name)
4199
4199
if (tp1.exists) this (x, tp1) else applyToPrefix(x, tp)
4200
4200
}
4201
- case tp : TermRef =>
4202
- if (stopAtStatic && tp.currentSymbol.isStatic) x
4203
- else applyToPrefix(x, tp)
4204
-
4205
- case _ : ThisType
4206
- | _ : BoundType
4207
- | NoPrefix => x
4208
4201
4209
4202
case tp @ AppliedType (tycon, args) =>
4210
4203
@ tailrec def foldArgs (x : T , tparams : List [ParamInfo ], args : List [Type ]): T =
@@ -4222,8 +4215,25 @@ object Types {
4222
4215
}
4223
4216
foldArgs(this (x, tycon), tp.typeParams, args)
4224
4217
4225
- case tp : RefinedType =>
4226
- this (this (x, tp.parent), tp.refinedInfo)
4218
+ case _ : BoundType | _ : ThisType => x
4219
+
4220
+ case tp : LambdaType =>
4221
+ variance = - variance
4222
+ val y = foldOver(x, tp.paramInfos)
4223
+ variance = - variance
4224
+ this (y, tp.resultType)
4225
+
4226
+ case NoPrefix => x
4227
+
4228
+ case tp : TermRef =>
4229
+ if (stopAtStatic && tp.currentSymbol.isStatic) x
4230
+ else applyToPrefix(x, tp)
4231
+
4232
+ case tp : TypeVar =>
4233
+ this (x, tp.underlying)
4234
+
4235
+ case ExprType (restpe) =>
4236
+ this (x, restpe)
4227
4237
4228
4238
case bounds @ TypeBounds (lo, hi) =>
4229
4239
if (lo eq hi) atVariance(0 )(this (x, lo))
@@ -4234,50 +4244,41 @@ object Types {
4234
4244
this (y, hi)
4235
4245
}
4236
4246
4237
- case tp : RecType =>
4238
- this (x, tp.parent )
4247
+ case tp : AndOrType =>
4248
+ this (this ( x, tp.tp1), tp.tp2 )
4239
4249
4240
- case ExprType (restpe ) =>
4241
- this (x, restpe )
4250
+ case AnnotatedType (underlying, annot ) =>
4251
+ this (applyToAnnot( x, annot), underlying )
4242
4252
4243
- case tp : TypeVar =>
4244
- this (x, tp.underlying )
4253
+ case tp : ProtoType =>
4254
+ tp.fold (x, this )
4245
4255
4246
- case SuperType (thistp, supertp) =>
4247
- this (this (x, thistp), supertp)
4256
+ case tp : RefinedType =>
4257
+ this (this (x, tp.parent), tp.refinedInfo)
4258
+
4259
+ case tp : WildcardType =>
4260
+ this (x, tp.optBounds)
4248
4261
4249
4262
case tp @ ClassInfo (prefix, _, _, _, _) =>
4250
4263
this (x, prefix)
4251
4264
4252
- case tp : LambdaType =>
4253
- variance = - variance
4254
- val y = foldOver(x, tp.paramInfos)
4255
- variance = - variance
4256
- this (y, tp.resultType)
4257
-
4258
- case tp : AndOrType =>
4259
- this (this (x, tp.tp1), tp.tp2)
4265
+ case tp : JavaArrayType =>
4266
+ this (x, tp.elemType)
4260
4267
4261
4268
case tp : SkolemType =>
4262
4269
this (x, tp.info)
4263
4270
4264
4271
case tp @ TypeArgRef (prefix, _, _) =>
4265
4272
atVariance(0 )(this (x, prefix))
4266
4273
4267
- case AnnotatedType (underlying, annot) =>
4268
- this (applyToAnnot(x, annot), underlying)
4269
-
4270
- case tp : WildcardType =>
4271
- this (x, tp.optBounds)
4272
-
4273
- case tp : JavaArrayType =>
4274
- this (x, tp.elemType)
4274
+ case SuperType (thistp, supertp) =>
4275
+ this (this (x, thistp), supertp)
4275
4276
4276
4277
case tp : LazyRef =>
4277
4278
this (x, tp.ref)
4278
4279
4279
- case tp : ProtoType =>
4280
- tp.fold (x, this )
4280
+ case tp : RecType =>
4281
+ this (x, tp.parent )
4281
4282
4282
4283
case _ => x
4283
4284
}}
@@ -4314,19 +4315,23 @@ object Types {
4314
4315
else {
4315
4316
seen += tp
4316
4317
tp match {
4317
- case tp : TermRef =>
4318
- apply(foldOver(maybeAdd(x, tp), tp), tp.underlying)
4319
4318
case tp : TypeRef =>
4320
4319
foldOver(maybeAdd(x, tp), tp)
4320
+ case tp : ThisType =>
4321
+ apply(x, tp.tref)
4322
+ case NoPrefix =>
4323
+ foldOver(x, tp)
4324
+ case tp : TermRef =>
4325
+ apply(foldOver(maybeAdd(x, tp), tp), tp.underlying)
4326
+ case tp : AppliedType =>
4327
+ foldOver(x, tp)
4321
4328
case TypeBounds (lo, hi) =>
4322
4329
if (! excludeLowerBounds) apply(x, lo)
4323
4330
apply(x, hi)
4324
- case tp : ThisType =>
4325
- apply(x, tp.tref)
4326
- case tp : ConstantType =>
4327
- apply(x, tp.underlying)
4328
4331
case tp : ParamRef =>
4329
4332
apply(x, tp.underlying)
4333
+ case tp : ConstantType =>
4334
+ apply(x, tp.underlying)
4330
4335
case _ =>
4331
4336
foldOver(x, tp)
4332
4337
}
0 commit comments