@@ -13,7 +13,8 @@ import dotty.tools.dotc.ast.tpd
1313import dotty .tools .dotc .ast .Trees
1414import dotty .tools .dotc .core .Annotations ._
1515import dotty .tools .dotc .core .Constants ._
16- import dotty .tools .dotc .core .Contexts .Context
16+ import dotty .tools .dotc .core .Contexts .{Context , atPhase }
17+ import dotty .tools .dotc .core .Phases ._
1718import dotty .tools .dotc .core .Decorators ._
1819import dotty .tools .dotc .core .Flags ._
1920import dotty .tools .dotc .core .Names .Name
@@ -45,7 +46,7 @@ trait BCodeHelpers extends BCodeIdiomatic with BytecodeWriters {
4546 import bTypes ._
4647 import tpd ._
4748 import coreBTypes ._
48- import int ._
49+ import int .{ _ , given _ }
4950 import DottyBackendInterface ._
5051
5152 def ScalaATTRName : String = " Scala"
@@ -360,7 +361,7 @@ trait BCodeHelpers extends BCodeIdiomatic with BytecodeWriters {
360361 val narg = normalizeArgument(arg)
361362 // Transformation phases are not run on annotation trees, so we need to run
362363 // `constToLiteral` at this point.
363- val t = constToLiteral(narg)(ctx.withPhase(ctx.erasurePhase ))
364+ val t = atPhase(erasurePhase)(constToLiteral(narg ))
364365 t match {
365366 case Literal (const @ Constant (_)) =>
366367 const.tag match {
@@ -464,7 +465,7 @@ trait BCodeHelpers extends BCodeIdiomatic with BytecodeWriters {
464465 } // end of trait BCAnnotGen
465466
466467 trait BCJGenSigGen {
467- import int ._
468+ import int .{ _ , given _ }
468469
469470 def getCurrentCUnit (): CompilationUnit
470471
@@ -478,7 +479,7 @@ trait BCodeHelpers extends BCodeIdiomatic with BytecodeWriters {
478479 * @see https://docs.oracle.com/javase/specs/jvms/se7/html/jvms-4.html#jvms-4.3.4
479480 */
480481 def getGenericSignature (sym : Symbol , owner : Symbol ): String = {
481- ctx. atPhase(ctx. erasurePhase) {
482+ atPhase(erasurePhase) {
482483 val memberTpe =
483484 if (sym.is(Method )) sym.denot.info
484485 else owner.denot.thisType.memberInfo(sym)
@@ -844,7 +845,7 @@ trait BCodeHelpers extends BCodeIdiomatic with BytecodeWriters {
844845 }
845846 }
846847
847- private def getGenericSignatureHelper (sym : Symbol , owner : Symbol , memberTpe : Type )(implicit ctx : Context ): Option [String ] = {
848+ private def getGenericSignatureHelper (sym : Symbol , owner : Symbol , memberTpe : Type )(using Context ): Option [String ] = {
848849 if (needsGenericSignature(sym)) {
849850 val erasedTypeSym = TypeErasure .fullErasure(sym.denot.info).typeSymbol
850851 if (erasedTypeSym.isPrimitiveValueClass) {
@@ -864,7 +865,7 @@ trait BCodeHelpers extends BCodeIdiomatic with BytecodeWriters {
864865 }
865866 }
866867
867- private def verifySignature (sym : Symbol , sig : String )(implicit ctx : Context ): Unit = {
868+ private def verifySignature (sym : Symbol , sig : String )(using Context ): Unit = {
868869 import scala .tools .asm .util .CheckClassAdapter
869870 def wrap (body : => Unit ): Unit = {
870871 try body
@@ -913,7 +914,7 @@ trait BCodeHelpers extends BCodeIdiomatic with BytecodeWriters {
913914 // But for now, just like we did in mixin, we just avoid writing a wrong generic signature
914915 // (one that doesn't erase to the actual signature). See run/t3452b for a test case.
915916
916- val memberTpe = ctx. atPhase(ctx. erasurePhase) { moduleClass.denot.thisType.memberInfo(sym) }
917+ val memberTpe = atPhase(erasurePhase) { moduleClass.denot.thisType.memberInfo(sym) }
917918 val erasedMemberType = TypeErasure .erasure(memberTpe)
918919 if (erasedMemberType =:= sym.denot.info)
919920 getGenericSignatureHelper(sym, moduleClass, memberTpe).orNull
0 commit comments