@@ -735,7 +735,10 @@ object Types {
735735 */
736736 final def asSeenFrom (pre : Type , cls : Symbol )(implicit ctx : Context ): Type = track(" asSeenFrom" ) {
737737 if (! cls.membersNeedAsSeenFrom(pre)) this
738- else ctx.asSeenFrom(this , pre, cls)
738+ else {
739+ record(" asSeenFrom" )
740+ ctx.asSeenFrom(this , pre, cls)
741+ }
739742 }
740743
741744// ----- Subtype-related --------------------------------------------
@@ -1260,7 +1263,8 @@ object Types {
12601263 /** Substitute all types that refer in their symbol attribute to
12611264 * one of the symbols in `from` by the corresponding types in `to`.
12621265 */
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" )
12641268 if (from.isEmpty) this
12651269 else {
12661270 val from1 = from.tail
@@ -1271,6 +1275,7 @@ object Types {
12711275 else ctx.subst(this , from, to)
12721276 }
12731277 }
1278+ }
12741279
12751280 /** Same as `subst` but follows aliases as a fallback. When faced with a reference
12761281 * to an alias type, where normal substitution does not yield a new type, the
@@ -1280,39 +1285,53 @@ object Types {
12801285 * of a class and also wants to substitute any parameter accessors that alias
12811286 * the type parameters.
12821287 */
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" )
12841290 ctx.substDealias(this , from, to)
1291+ }
12851292
12861293 /** Substitute all types of the form `TypeParamRef(from, N)` by
12871294 * `TypeParamRef(to, N)`.
12881295 */
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" )
12901298 ctx.subst(this , from, to)
1299+ }
12911300
12921301 /** 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" )
12941304 ctx.substThis(this , cls, tp)
1305+ }
12951306
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) */
12971308 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+ }
13001313 /** Substitute all occurrences of `RecThis(binder)` by `tp` */
13011314 final def substRecThis (binder : RecType , tp : Type )(implicit ctx : Context ): Type =
13021315 ctx.substRecThis(this , binder, tp)
13031316
13041317 /** 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" )
13061320 ctx.substParam(this , from, to)
1321+ }
13071322
13081323 /** 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" )
13101326 ctx.substParams(this , from, to)
1327+ }
13111328
13121329 /** Substitute all occurrences of symbols in `from` by references to corresponding symbols in `to`
13131330 */
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" )
13151333 ctx.substSym(this , from, to)
1334+ }
13161335
13171336// ----- misc -----------------------------------------------------------
13181337
@@ -3769,6 +3788,8 @@ object Types {
37693788 abstract class TypeMap (implicit protected val ctx : Context )
37703789 extends VariantTraversal with (Type => Type ) { thisMap =>
37713790
3791+ record(" all typemaps" )
3792+ record(s " typemap: $getClass" )
37723793 protected def stopAtStatic = true
37733794
37743795 def apply (tp : Type ): Type
@@ -3834,6 +3855,7 @@ object Types {
38343855
38353856 def mapOver2 (tp : Type ) = tp match {
38363857 case tp : AppliedType =>
3858+ record(s " mapOver2 AppliedType " )
38373859 def mapArgs (args : List [Type ], tparams : List [ParamInfo ]): List [Type ] = args match {
38383860 case arg :: otherArgs =>
38393861 val arg1 = arg match {
@@ -3852,6 +3874,7 @@ object Types {
38523874 }
38533875
38543876 def mapOver3 (tp : Type ) = {
3877+ record(s " mapOver3 ${tp.getClass}" )
38553878 implicit val ctx = this .ctx
38563879 tp match {
38573880 case tp : RefinedType =>
@@ -3978,7 +4001,7 @@ object Types {
39784001 */
39794002 abstract class ApproximatingTypeMap (implicit ctx : Context ) extends TypeMap { thisMap =>
39804003
3981- protected def range (lo : Type , hi : Type ) =
4004+ def range (lo : Type , hi : Type ) =
39824005 if (variance > 0 ) hi
39834006 else if (variance < 0 ) lo
39844007 else Range (lower(lo), upper(hi))
0 commit comments