@@ -15,7 +15,7 @@ import dotty.tools.dotc.core.Annotations.Annotation
15
15
import dotty .tools .dotc .core .Constants ._
16
16
import dotty .tools .dotc .core .Contexts .Context
17
17
import dotty .tools .dotc .core .Decorators ._
18
- import dotty .tools .dotc .core .Flags
18
+ import dotty .tools .dotc .core .Flags . _
19
19
import dotty .tools .dotc .core .Names .Name
20
20
import dotty .tools .dotc .core .NameKinds .ExpandedName
21
21
import dotty .tools .dotc .core .Signature
@@ -225,7 +225,7 @@ trait BCodeHelpers extends BCodeIdiomatic with BytecodeWriters {
225
225
// If the `sym` is a java module class, we use the java class instead. This ensures that we
226
226
// register the class (instead of the module class) in innerClassBufferASM.
227
227
// The two symbols have the same name, so the resulting internalName is the same.
228
- val classSym = if (sym.is(Flags . JavaDefined ) && sym.is(Flags . ModuleClass )) sym.linkedClass else sym
228
+ val classSym = if (sym.is(JavaDefined ) && sym.is(ModuleClass )) sym.linkedClass else sym
229
229
getClassBTypeAndRegisterInnerClass(classSym).internalName
230
230
}
231
231
@@ -269,7 +269,7 @@ trait BCodeHelpers extends BCodeIdiomatic with BytecodeWriters {
269
269
* must-single-thread
270
270
*/
271
271
final def asmMethodType (msym : Symbol ): MethodBType = {
272
- assert(msym.is(Flags . Method ), s " not a method-symbol: $msym" )
272
+ assert(msym.is(Method ), s " not a method-symbol: $msym" )
273
273
val resT : BType =
274
274
if (msym.isClassConstructor || msym.isConstructor) UNIT
275
275
else toTypeKind(msym.info.resultType)
@@ -343,7 +343,7 @@ trait BCodeHelpers extends BCodeIdiomatic with BytecodeWriters {
343
343
344
344
345
345
private def shouldEmitAnnotation (annot : Annotation ): Boolean = {
346
- annot.symbol.is(Flags . JavaDefined ) &&
346
+ annot.symbol.is(JavaDefined ) &&
347
347
retentionPolicyOf(annot) != AnnotationRetentionSourceAttr
348
348
}
349
349
@@ -378,7 +378,7 @@ trait BCodeHelpers extends BCodeIdiomatic with BytecodeWriters {
378
378
av.visit(name, typeToTypeKind(t.args.head.tpe.classSymbol.denot.info)(bcodeStore)(innerClasesStore).toASMType)
379
379
case Ident (nme.WILDCARD ) =>
380
380
// An underscore argument indicates that we want to use the default value for this parameter, so do not emit anything
381
- case t : tpd.RefTree if t.symbol.denot.owner.isAllOf(Flags . JavaEnumTrait ) =>
381
+ case t : tpd.RefTree if t.symbol.denot.owner.isAllOf(JavaEnumTrait ) =>
382
382
val edesc = innerClasesStore.typeDescriptor(t.tpe) // the class descriptor of the enumeration class.
383
383
val evalue = t.symbol.javaSimpleName // value the actual enumeration value.
384
384
av.visitEnum(name, edesc, evalue)
@@ -482,7 +482,7 @@ trait BCodeHelpers extends BCodeIdiomatic with BytecodeWriters {
482
482
def getGenericSignature (sym : Symbol , owner : Symbol ): String = {
483
483
ctx.atPhase(ctx.erasurePhase) {
484
484
val memberTpe =
485
- if (sym.is(Flags . Method )) sym.denot.info
485
+ if (sym.is(Method )) sym.denot.info
486
486
else owner.denot.thisType.memberInfo(sym)
487
487
getGenericSignatureHelper(sym, owner, memberTpe).orNull
488
488
}
@@ -509,7 +509,7 @@ trait BCodeHelpers extends BCodeIdiomatic with BytecodeWriters {
509
509
// TODO: evaluate the other flags we might be dropping on the floor here.
510
510
// TODO: ACC_SYNTHETIC ?
511
511
val flags = GenBCodeOps .PublicStatic | (
512
- if (m.is(Flags . JavaVarargs )) asm.Opcodes .ACC_VARARGS else 0
512
+ if (m.is(JavaVarargs )) asm.Opcodes .ACC_VARARGS else 0
513
513
)
514
514
515
515
// TODO needed? for(ann <- m.annotations) { ann.symbol.initialize }
@@ -563,7 +563,7 @@ trait BCodeHelpers extends BCodeIdiomatic with BytecodeWriters {
563
563
* must-single-thread
564
564
*/
565
565
def addForwarders (jclass : asm.ClassVisitor , jclassName : String , moduleClass : Symbol ): Unit = {
566
- assert(moduleClass.is(Flags . ModuleClass ), moduleClass)
566
+ assert(moduleClass.is(ModuleClass ), moduleClass)
567
567
ctx.debuglog(s " Dumping mirror class for object: $moduleClass" )
568
568
569
569
val linkedClass = moduleClass.companionClass
@@ -572,11 +572,11 @@ trait BCodeHelpers extends BCodeIdiomatic with BytecodeWriters {
572
572
}
573
573
ctx.debuglog(s " Potentially conflicting names for forwarders: $conflictingNames" )
574
574
575
- for (m0 <- sortedMembersBasedOnFlags(moduleClass.info, required = Flags . Method , excluded = Flags . ExcludedForwarder )) {
576
- val m = if (m0.is(Flags . Bridge )) m0.nextOverriddenSymbol else m0
575
+ for (m0 <- sortedMembersBasedOnFlags(moduleClass.info, required = Method , excluded = ExcludedForwarder )) {
576
+ val m = if (m0.is(Bridge )) m0.nextOverriddenSymbol else m0
577
577
if (m == NoSymbol )
578
578
ctx.log(s " $m0 is a bridge method that overrides nothing, something went wrong in a previous phase. " )
579
- else if (m.isType || m.is(Flags . Deferred ) || (m.owner eq defn.ObjectClass ) || m.isConstructor || m.name.is(ExpandedName ))
579
+ else if (m.isType || m.is(Deferred ) || (m.owner eq defn.ObjectClass ) || m.isConstructor || m.name.is(ExpandedName ))
580
580
ctx.debuglog(s " No forwarder for ' $m' from $jclassName to ' $moduleClass' " )
581
581
else if (conflictingNames(m.name))
582
582
ctx.log(s " No forwarder for $m due to conflict with ${linkedClass.info.member(m.name)}" )
@@ -592,7 +592,7 @@ trait BCodeHelpers extends BCodeIdiomatic with BytecodeWriters {
592
592
/** The members of this type that have all of `required` flags but none of `excluded` flags set.
593
593
* The members are sorted by name and signature to guarantee a stable ordering.
594
594
*/
595
- private def sortedMembersBasedOnFlags (tp : Type , required : Flags . Flag , excluded : Flags . FlagSet ): List [Symbol ] = {
595
+ private def sortedMembersBasedOnFlags (tp : Type , required : Flag , excluded : FlagSet ): List [Symbol ] = {
596
596
// The output of `memberNames` is a Set, sort it to guarantee a stable ordering.
597
597
val names = tp.memberNames(takeAllFilter).toSeq.sorted
598
598
val buffer = mutable.ListBuffer [Symbol ]()
@@ -667,7 +667,7 @@ trait BCodeHelpers extends BCodeIdiomatic with BytecodeWriters {
667
667
* must-single-thread
668
668
*/
669
669
def genMirrorClass (moduleClass : Symbol , cunit : CompilationUnit ): asm.tree.ClassNode = {
670
- assert(moduleClass.is(Flags . ModuleClass ))
670
+ assert(moduleClass.is(ModuleClass ))
671
671
assert(moduleClass.companionClass == NoSymbol , moduleClass)
672
672
innerClassBufferASM.clear()
673
673
this .cunit = cunit
@@ -690,7 +690,7 @@ trait BCodeHelpers extends BCodeIdiomatic with BytecodeWriters {
690
690
null /* SourceDebugExtension */ )
691
691
}
692
692
693
- val ssa = None // getAnnotPickle(mirrorName, if (moduleClass.is(Flags. Module)) moduleClass.companionClass else moduleClass.companionModule)
693
+ val ssa = None // getAnnotPickle(mirrorName, if (moduleClass.is(Module)) moduleClass.companionClass else moduleClass.companionModule)
694
694
mirrorClass.visitAttribute(if (ssa.isDefined) pickleMarkerLocal else pickleMarkerForeign)
695
695
emitAnnotations(mirrorClass, moduleClass.annotations ++ ssa)
696
696
@@ -892,7 +892,7 @@ trait BCodeHelpers extends BCodeIdiomatic with BytecodeWriters {
892
892
}
893
893
894
894
wrap {
895
- if (sym.is(Flags . Method )) {
895
+ if (sym.is(Method )) {
896
896
CheckClassAdapter .checkMethodSignature(sig)
897
897
}
898
898
else if (sym.isTerm) {
@@ -914,9 +914,9 @@ trait BCodeHelpers extends BCodeIdiomatic with BytecodeWriters {
914
914
// generic information could disappear as a consequence of a seemingly
915
915
// unrelated change.
916
916
ctx.base.settings.YnoGenericSig .value
917
- || sym.is(Flags . Artifact )
918
- || sym.isAllOf(Flags . LiftedMethod )
919
- || sym.is(Flags . Bridge )
917
+ || sym.is(Artifact )
918
+ || sym.isAllOf(LiftedMethod )
919
+ || sym.is(Bridge )
920
920
)
921
921
922
922
private def getStaticForwarderGenericSignature (sym : Symbol , moduleClass : Symbol ): String = {
0 commit comments