@@ -735,7 +735,10 @@ object Types {
735
735
*/
736
736
final def asSeenFrom (pre : Type , cls : Symbol )(implicit ctx : Context ): Type = track(" asSeenFrom" ) {
737
737
if (! cls.membersNeedAsSeenFrom(pre)) this
738
- else ctx.asSeenFrom(this , pre, cls)
738
+ else {
739
+ record(" asSeenFrom" )
740
+ ctx.asSeenFrom(this , pre, cls)
741
+ }
739
742
}
740
743
741
744
// ----- Subtype-related --------------------------------------------
@@ -1260,7 +1263,8 @@ object Types {
1260
1263
/** Substitute all types that refer in their symbol attribute to
1261
1264
* one of the symbols in `from` by the corresponding types in `to`.
1262
1265
*/
1263
- final def subst (from : List [Symbol ], to : List [Type ])(implicit ctx : Context ): Type =
1266
+ final def subst (from : List [Symbol ], to : List [Type ])(implicit ctx : Context ): Type = {
1267
+ record(" substSymsTypes" )
1264
1268
if (from.isEmpty) this
1265
1269
else {
1266
1270
val from1 = from.tail
@@ -1271,6 +1275,7 @@ object Types {
1271
1275
else ctx.subst(this , from, to)
1272
1276
}
1273
1277
}
1278
+ }
1274
1279
1275
1280
/** Same as `subst` but follows aliases as a fallback. When faced with a reference
1276
1281
* to an alias type, where normal substitution does not yield a new type, the
@@ -1280,39 +1285,53 @@ object Types {
1280
1285
* of a class and also wants to substitute any parameter accessors that alias
1281
1286
* the type parameters.
1282
1287
*/
1283
- final def substDealias (from : List [Symbol ], to : List [Type ])(implicit ctx : Context ): Type =
1288
+ final def substDealias (from : List [Symbol ], to : List [Type ])(implicit ctx : Context ): Type = {
1289
+ record(" substDealias" )
1284
1290
ctx.substDealias(this , from, to)
1291
+ }
1285
1292
1286
1293
/** Substitute all types of the form `TypeParamRef(from, N)` by
1287
1294
* `TypeParamRef(to, N)`.
1288
1295
*/
1289
- final def subst (from : BindingType , to : BindingType )(implicit ctx : Context ): Type =
1296
+ final def subst (from : BindingType , to : BindingType )(implicit ctx : Context ): Type = {
1297
+ record(" substBindings" )
1290
1298
ctx.subst(this , from, to)
1299
+ }
1291
1300
1292
1301
/** Substitute all occurrences of `This(cls)` by `tp` */
1293
- final def substThis (cls : ClassSymbol , tp : Type )(implicit ctx : Context ): Type =
1302
+ final def substThis (cls : ClassSymbol , tp : Type )(implicit ctx : Context ): Type = {
1303
+ record(" substThis" )
1294
1304
ctx.substThis(this , cls, tp)
1305
+ }
1295
1306
1296
- /** As substThis, but only is class is a static owner (i.e. a globally accessible object) */
1307
+ /** As substThis, but only is class is not a static owner (i.e. a globally accessible object) */
1297
1308
final def substThisUnlessStatic (cls : ClassSymbol , tp : Type )(implicit ctx : Context ): Type =
1298
- if (cls.isStaticOwner) this else ctx.substThis(this , cls, tp)
1299
-
1309
+ if (cls.isStaticOwner) this else {
1310
+ record(" substThis" )
1311
+ ctx.substThis(this , cls, tp)
1312
+ }
1300
1313
/** Substitute all occurrences of `RecThis(binder)` by `tp` */
1301
1314
final def substRecThis (binder : RecType , tp : Type )(implicit ctx : Context ): Type =
1302
1315
ctx.substRecThis(this , binder, tp)
1303
1316
1304
1317
/** Substitute a bound type by some other type */
1305
- final def substParam (from : ParamRef , to : Type )(implicit ctx : Context ): Type =
1318
+ final def substParam (from : ParamRef , to : Type )(implicit ctx : Context ): Type = {
1319
+ record(" substParam" )
1306
1320
ctx.substParam(this , from, to)
1321
+ }
1307
1322
1308
1323
/** Substitute bound types by some other types */
1309
- final def substParams (from : BindingType , to : List [Type ])(implicit ctx : Context ): Type =
1324
+ final def substParams (from : BindingType , to : List [Type ])(implicit ctx : Context ): Type = {
1325
+ record(" substParams" )
1310
1326
ctx.substParams(this , from, to)
1327
+ }
1311
1328
1312
1329
/** Substitute all occurrences of symbols in `from` by references to corresponding symbols in `to`
1313
1330
*/
1314
- final def substSym (from : List [Symbol ], to : List [Symbol ])(implicit ctx : Context ): Type =
1331
+ final def substSym (from : List [Symbol ], to : List [Symbol ])(implicit ctx : Context ): Type = {
1332
+ record(" substSym" )
1315
1333
ctx.substSym(this , from, to)
1334
+ }
1316
1335
1317
1336
// ----- misc -----------------------------------------------------------
1318
1337
@@ -3769,6 +3788,8 @@ object Types {
3769
3788
abstract class TypeMap (implicit protected val ctx : Context )
3770
3789
extends VariantTraversal with (Type => Type ) { thisMap =>
3771
3790
3791
+ record(" all typemaps" )
3792
+ record(s " typemap: $getClass" )
3772
3793
protected def stopAtStatic = true
3773
3794
3774
3795
def apply (tp : Type ): Type
@@ -3834,6 +3855,7 @@ object Types {
3834
3855
3835
3856
def mapOver2 (tp : Type ) = tp match {
3836
3857
case tp : AppliedType =>
3858
+ record(s " mapOver2 AppliedType " )
3837
3859
def mapArgs (args : List [Type ], tparams : List [ParamInfo ]): List [Type ] = args match {
3838
3860
case arg :: otherArgs =>
3839
3861
val arg1 = arg match {
@@ -3852,6 +3874,7 @@ object Types {
3852
3874
}
3853
3875
3854
3876
def mapOver3 (tp : Type ) = {
3877
+ record(s " mapOver3 ${tp.getClass}" )
3855
3878
implicit val ctx = this .ctx
3856
3879
tp match {
3857
3880
case tp : RefinedType =>
@@ -3978,7 +4001,7 @@ object Types {
3978
4001
*/
3979
4002
abstract class ApproximatingTypeMap (implicit ctx : Context ) extends TypeMap { thisMap =>
3980
4003
3981
- protected def range (lo : Type , hi : Type ) =
4004
+ def range (lo : Type , hi : Type ) =
3982
4005
if (variance > 0 ) hi
3983
4006
else if (variance < 0 ) lo
3984
4007
else Range (lower(lo), upper(hi))
0 commit comments