@@ -13,7 +13,8 @@ import dotty.tools.dotc.ast.tpd
13
13
import dotty .tools .dotc .ast .Trees
14
14
import dotty .tools .dotc .core .Annotations ._
15
15
import 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 ._
17
18
import dotty .tools .dotc .core .Decorators ._
18
19
import dotty .tools .dotc .core .Flags ._
19
20
import dotty .tools .dotc .core .Names .Name
@@ -45,7 +46,7 @@ trait BCodeHelpers extends BCodeIdiomatic with BytecodeWriters {
45
46
import bTypes ._
46
47
import tpd ._
47
48
import coreBTypes ._
48
- import int ._
49
+ import int .{ _ , given _ }
49
50
import DottyBackendInterface ._
50
51
51
52
def ScalaATTRName : String = " Scala"
@@ -360,7 +361,7 @@ trait BCodeHelpers extends BCodeIdiomatic with BytecodeWriters {
360
361
val narg = normalizeArgument(arg)
361
362
// Transformation phases are not run on annotation trees, so we need to run
362
363
// `constToLiteral` at this point.
363
- val t = constToLiteral(narg)(ctx.withPhase(ctx.erasurePhase ))
364
+ val t = atPhase(erasurePhase)(constToLiteral(narg ))
364
365
t match {
365
366
case Literal (const @ Constant (_)) =>
366
367
const.tag match {
@@ -464,7 +465,7 @@ trait BCodeHelpers extends BCodeIdiomatic with BytecodeWriters {
464
465
} // end of trait BCAnnotGen
465
466
466
467
trait BCJGenSigGen {
467
- import int ._
468
+ import int .{ _ , given _ }
468
469
469
470
def getCurrentCUnit (): CompilationUnit
470
471
@@ -478,7 +479,7 @@ trait BCodeHelpers extends BCodeIdiomatic with BytecodeWriters {
478
479
* @see https://docs.oracle.com/javase/specs/jvms/se7/html/jvms-4.html#jvms-4.3.4
479
480
*/
480
481
def getGenericSignature (sym : Symbol , owner : Symbol ): String = {
481
- ctx. atPhase(ctx. erasurePhase) {
482
+ atPhase(erasurePhase) {
482
483
val memberTpe =
483
484
if (sym.is(Method )) sym.denot.info
484
485
else owner.denot.thisType.memberInfo(sym)
@@ -844,7 +845,7 @@ trait BCodeHelpers extends BCodeIdiomatic with BytecodeWriters {
844
845
}
845
846
}
846
847
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 ] = {
848
849
if (needsGenericSignature(sym)) {
849
850
val erasedTypeSym = TypeErasure .fullErasure(sym.denot.info).typeSymbol
850
851
if (erasedTypeSym.isPrimitiveValueClass) {
@@ -864,7 +865,7 @@ trait BCodeHelpers extends BCodeIdiomatic with BytecodeWriters {
864
865
}
865
866
}
866
867
867
- private def verifySignature (sym : Symbol , sig : String )(implicit ctx : Context ): Unit = {
868
+ private def verifySignature (sym : Symbol , sig : String )(using Context ): Unit = {
868
869
import scala .tools .asm .util .CheckClassAdapter
869
870
def wrap (body : => Unit ): Unit = {
870
871
try body
@@ -913,7 +914,7 @@ trait BCodeHelpers extends BCodeIdiomatic with BytecodeWriters {
913
914
// But for now, just like we did in mixin, we just avoid writing a wrong generic signature
914
915
// (one that doesn't erase to the actual signature). See run/t3452b for a test case.
915
916
916
- val memberTpe = ctx. atPhase(ctx. erasurePhase) { moduleClass.denot.thisType.memberInfo(sym) }
917
+ val memberTpe = atPhase(erasurePhase) { moduleClass.denot.thisType.memberInfo(sym) }
917
918
val erasedMemberType = TypeErasure .erasure(memberTpe)
918
919
if (erasedMemberType =:= sym.denot.info)
919
920
getGenericSignatureHelper(sym, moduleClass, memberTpe).orNull
0 commit comments