@@ -13,7 +13,7 @@ import Decorators.{given _}, DenotTransformers._
1313import collection .{immutable , mutable }
1414import util .{Property , SourceFile , NoSource }
1515import NameKinds .{TempResultName , OuterSelectName }
16- import Phases .currentPhase
16+ import Phases .{ currentPhase , currentlyAfterErasure }
1717import typer .ConstFold
1818
1919import scala .annotation .tailrec
@@ -415,7 +415,7 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {
415415 ref(NamedType (sym.owner.thisType, sym.name, sym.denot))
416416
417417 private def followOuterLinks (t : Tree )(using Context ) = t match {
418- case t : This if ctx.erasedTypes && ! (t.symbol == ctx.owner.enclosingClass || t.symbol.isStaticOwner) =>
418+ case t : This if currentlyAfterErasure && ! (t.symbol == ctx.owner.enclosingClass || t.symbol.isStaticOwner) =>
419419 // after erasure outer paths should be respected
420420 ExplicitOuter .OuterOps (ctx).path(toCls = t.tpe.widen.classSymbol)
421421 case t =>
@@ -459,7 +459,7 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {
459459 def newArr =
460460 ref(defn.DottyArraysModule ).select(defn.newArrayMethod).withSpan(span)
461461
462- if (! ctx.erasedTypes ) {
462+ if (! currentlyAfterErasure ) {
463463 assert(! TypeErasure .isGeneric(elemTpe), elemTpe) // needs to be done during typer. See Applications.convertNewGenericArray
464464 newArr.appliedToTypeTrees(TypeTree (returnTpe) :: Nil ).appliedToArgs(clsOf(elemTpe) :: clsOf(returnTpe) :: dims :: Nil ).withSpan(span)
465465 }
@@ -963,7 +963,7 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {
963963 /** cast tree to `tp`, assuming no exception is raised, i.e the operation is pure */
964964 def cast (tp : Type )(using Context ): Tree = {
965965 assert(tp.isValueType, i " bad cast: $tree.asInstanceOf[ $tp] " )
966- tree.select(if (ctx.erasedTypes ) defn.Any_asInstanceOf else defn.Any_typeCast )
966+ tree.select(if (currentlyAfterErasure ) defn.Any_asInstanceOf else defn.Any_typeCast )
967967 .appliedToType(tp)
968968 }
969969
@@ -973,7 +973,7 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {
973973 */
974974 def ensureConforms (tp : Type )(using Context ): Tree =
975975 if (tree.tpe <:< tp) tree
976- else if (! ctx.erasedTypes ) cast(tp)
976+ else if (! currentlyAfterErasure ) cast(tp)
977977 else Erasure .Boxing .adaptToType(tree, tp)
978978
979979 /** `tree ne null` (might need a cast to be type correct) */
@@ -1157,7 +1157,7 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {
11571157
11581158 /** A tree that corresponds to `Predef.classOf[$tp]` in source */
11591159 def clsOf (tp : Type )(using Context ): Tree =
1160- if ctx.erasedTypes then
1160+ if currentlyAfterErasure then
11611161 def TYPE (module : TermSymbol ) = ref(module).select(nme.TYPE_ )
11621162 defn.scalaClassName(tp) match
11631163 case tpnme.Boolean => TYPE (defn.BoxedBooleanModule )
0 commit comments