Skip to content

Commit 7e9d71d

Browse files
committed
Use isOneOf for checking flag sets with more than one member
1 parent ec4c54d commit 7e9d71d

File tree

75 files changed

+421
-401
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+421
-401
lines changed

compiler/src/dotty/tools/backend/jvm/DottyBackendInterface.scala

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -657,50 +657,50 @@ class DottyBackendInterface(outputDirectory: AbstractFile, val superCallsMap: Ma
657657
def isConstructor: Boolean = toDenot(sym).isConstructor
658658
def isExpanded: Boolean = sym.name.is(ExpandedName)
659659
def isAnonymousFunction: Boolean = toDenot(sym).isAnonymousFunction
660-
def isMethod: Boolean = sym is Flags.Method
661-
def isPublic: Boolean = sym.flags.is(Flags.EmptyFlags, Flags.Private | Flags.Protected)
662-
def isSynthetic: Boolean = sym is Flags.Synthetic
663-
def isPackageClass: Boolean = sym is Flags.PackageClass
664-
def isModuleClass: Boolean = sym is Flags.ModuleClass
665-
def isModule: Boolean = sym is Flags.Module
660+
def isMethod: Boolean = sym.is(Flags.Method)
661+
def isPublic: Boolean = !sym.flags.is(Flags.Private | Flags.Protected)
662+
def isSynthetic: Boolean = sym.is(Flags.Synthetic)
663+
def isPackageClass: Boolean = sym.is(Flags.PackageClass)
664+
def isModuleClass: Boolean = sym.is(Flags.ModuleClass)
665+
def isModule: Boolean = sym.is(Flags.Module)
666666
def isStrictFP: Boolean = false // todo: implement
667-
def isLabel: Boolean = sym is Flags.Label
668-
def hasPackageFlag: Boolean = sym is Flags.Package
669-
def isInterface: Boolean = (sym is Flags.PureInterface) || (sym is Flags.Trait)
667+
def isLabel: Boolean = sym.is(Flags.Label)
668+
def hasPackageFlag: Boolean = sym.is(Flags.Package)
669+
def isInterface: Boolean = (sym.is(Flags.PureInterface)) || (sym.is(Flags.Trait))
670670
def isGetter: Boolean = toDenot(sym).isGetter
671671
def isSetter: Boolean = toDenot(sym).isSetter
672672
def isGetClass: Boolean = sym eq defn.Any_getClass
673-
def isJavaDefined: Boolean = sym is Flags.JavaDefined
674-
def isJavaDefaultMethod: Boolean = !((sym is Flags.Deferred) || toDenot(sym).isClassConstructor)
675-
def isDeferred: Boolean = sym is Flags.Deferred
676-
def isPrivate: Boolean = sym is Flags.Private
673+
def isJavaDefined: Boolean = sym.is(Flags.JavaDefined)
674+
def isJavaDefaultMethod: Boolean = !((sym.is(Flags.Deferred)) || toDenot(sym).isClassConstructor)
675+
def isDeferred: Boolean = sym.is(Flags.Deferred)
676+
def isPrivate: Boolean = sym.is(Flags.Private)
677677
def getsJavaFinalFlag: Boolean =
678-
isFinal && !toDenot(sym).isClassConstructor && !(sym is Flags.Mutable) && !(sym.enclosingClass is Flags.Trait)
678+
isFinal && !toDenot(sym).isClassConstructor && !(sym.is(Flags.Mutable)) && !(sym.enclosingClass.is(Flags.Trait))
679679

680680
def getsJavaPrivateFlag: Boolean =
681681
isPrivate //|| (sym.isPrimaryConstructor && sym.owner.isTopLevelModuleClass)
682682

683-
def isFinal: Boolean = sym is Flags.Final
683+
def isFinal: Boolean = sym.is(Flags.Final)
684684
def isStaticMember: Boolean = (sym ne NoSymbol) &&
685-
((sym is Flags.JavaStatic) || toDenot(sym).hasAnnotation(ctx.definitions.ScalaStaticAnnot))
685+
((sym.is(Flags.JavaStatic)) || toDenot(sym).hasAnnotation(ctx.definitions.ScalaStaticAnnot))
686686
// guard against no sumbol cause this code is executed to select which call type(static\dynamic) to use to call array.clone
687687

688688
def isBottomClass: Boolean = (sym ne defn.NullClass) && (sym ne defn.NothingClass)
689-
def isBridge: Boolean = sym is Flags.Bridge
690-
def isArtifact: Boolean = sym is Flags.Artifact
689+
def isBridge: Boolean = sym.is(Flags.Bridge)
690+
def isArtifact: Boolean = sym.is(Flags.Artifact)
691691
def hasEnumFlag: Boolean = sym.isAll(Flags.JavaEnum)
692692
def hasAccessBoundary: Boolean = sym.accessBoundary(defn.RootClass) ne defn.RootClass
693-
def isVarargsMethod: Boolean = sym is Flags.JavaVarargs
693+
def isVarargsMethod: Boolean = sym.is(Flags.JavaVarargs)
694694
def isDeprecated: Boolean = false
695-
def isMutable: Boolean = sym is Flags.Mutable
695+
def isMutable: Boolean = sym.is(Flags.Mutable)
696696
def hasAbstractFlag: Boolean =
697-
(sym is Flags.Abstract) || (sym.isAll(Flags.JavaInterface)) || (sym is Flags.Trait)
698-
def hasModuleFlag: Boolean = sym is Flags.Module
699-
def isSynchronized: Boolean = sym is Flags.Synchronized
697+
(sym.is(Flags.Abstract)) || (sym.isAll(Flags.JavaInterface)) || (sym.is(Flags.Trait))
698+
def hasModuleFlag: Boolean = sym.is(Flags.Module)
699+
def isSynchronized: Boolean = sym.is(Flags.Synchronized)
700700
def isNonBottomSubClass(other: Symbol): Boolean = sym.derivesFrom(other)
701701
def hasAnnotation(ann: Symbol): Boolean = toDenot(sym).hasAnnotation(ann)
702702
def shouldEmitForwarders: Boolean =
703-
(sym is Flags.Module) && sym.isStatic
703+
(sym.is(Flags.Module)) && sym.isStatic
704704
def isJavaEntryPoint: Boolean = CollectEntryPoints.isJavaEntryPoint(sym)
705705

706706
def isClassConstructor: Boolean = toDenot(sym).isClassConstructor
@@ -711,7 +711,7 @@ class DottyBackendInterface(outputDirectory: AbstractFile, val superCallsMap: Ma
711711
* for such objects will get a MODULE$ flag and a corresponding static initializer.
712712
*/
713713
def isStaticModuleClass: Boolean =
714-
(sym is Flags.Module) && {
714+
(sym.is(Flags.Module)) && {
715715
// scalac uses atPickling here
716716
// this would not work if modules are created after pickling
717717
// for example by specialization
@@ -734,7 +734,7 @@ class DottyBackendInterface(outputDirectory: AbstractFile, val superCallsMap: Ma
734734
def superClass: Symbol = {
735735
val t = toDenot(sym).asClass.superClass
736736
if (t.exists) t
737-
else if (sym is Flags.ModuleClass) {
737+
else if (sym.is(Flags.ModuleClass)) {
738738
// workaround #371
739739

740740
println(s"Warning: mocking up superclass for $sym")
@@ -747,7 +747,7 @@ class DottyBackendInterface(outputDirectory: AbstractFile, val superCallsMap: Ma
747747
def linkedClass: Symbol = toDenot(sym)(ctx).linkedClass(ctx) //exitingPickler(sym.linkedClassOfClass)
748748
def companionClass: Symbol = toDenot(sym).companionClass
749749
def companionModule: Symbol = toDenot(sym).companionModule
750-
def companionSymbol: Symbol = if (sym is Flags.Module) companionClass else companionModule
750+
def companionSymbol: Symbol = if (sym.is(Flags.Module)) companionClass else companionModule
751751
def moduleClass: Symbol = toDenot(sym).moduleClass
752752
def enclosingClassSym: Symbol = {
753753
if (this.isClass) {
@@ -857,7 +857,7 @@ class DottyBackendInterface(outputDirectory: AbstractFile, val superCallsMap: Ma
857857
implicit def typeHelper(tp: Type): TypeHelper = new TypeHelper {
858858
def member(string: Name): Symbol = tp.member(string.toTermName).symbol
859859

860-
def isFinalType: Boolean = tp.typeSymbol is Flags.Final //in scalac checks for type parameters. Why? Aren't they gone by backend?
860+
def isFinalType: Boolean = tp.typeSymbol.is(Flags.Final) //in scalac checks for type parameters. Why? Aren't they gone by backend?
861861

862862
def underlying: Type = tp match {
863863
case t: TypeProxy => t.underlying

compiler/src/dotty/tools/backend/sjs/JSCodeGen.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,7 @@ class JSCodeGen()(implicit ctx: Context) {
537537
implicit pos: Position): Option[js.Tree] = {
538538
val ctors =
539539
if (sym.is(Abstract)) Nil
540-
else sym.info.member(nme.CONSTRUCTOR).alternatives.map(_.symbol).filter(m => !m.is(Private | Protected))
540+
else sym.info.member(nme.CONSTRUCTOR).alternatives.map(_.symbol).filter(m => !m.isOneOf(Private | Protected))
541541

542542
if (ctors.isEmpty) {
543543
None

compiler/src/dotty/tools/backend/sjs/JUnitBootstrappers.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ class JUnitBootstrappers extends MiniPhase {
128128

129129
def isTestClass(sym: Symbol): Boolean = {
130130
sym.isClass &&
131-
!sym.is(ModuleClass | Abstract | Trait) &&
131+
!sym.isOneOf(ModuleClass | Abstract | Trait) &&
132132
hasTests(sym.asClass)
133133
}
134134

compiler/src/dotty/tools/dotc/ast/Desugar.scala

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,10 @@ object desugar {
8989
* in apply/unapply methods.
9090
*/
9191
override def ensureCompletions(implicit ctx: Context): Unit =
92-
if (!(ctx.owner is Package))
92+
if (!ctx.owner.is(Package))
9393
if (ctx.owner.isClass) {
9494
ctx.owner.ensureCompleted()
95-
if (ctx.owner is ModuleClass)
95+
if (ctx.owner.is(ModuleClass))
9696
ctx.owner.linkedClass.ensureCompleted()
9797
}
9898
else ensureCompletions(ctx.outer)
@@ -158,7 +158,7 @@ object desugar {
158158
val vdef @ ValDef(name, tpt, rhs) = transformQuotedPatternName(vdef0)
159159
val mods = vdef.mods
160160
val setterNeeded =
161-
(mods is Mutable) && ctx.owner.isClass && (!mods.isAll(PrivateLocal) || (ctx.owner is Trait))
161+
mods.is(Mutable) && ctx.owner.isClass && (!mods.isAll(PrivateLocal) || ctx.owner.is(Trait))
162162
if (setterNeeded) {
163163
// TODO: copy of vdef as getter needed?
164164
// val getter = ValDef(mods, name, tpt, rhs) withPos vdef.pos?
@@ -322,7 +322,7 @@ object desugar {
322322
meth
323323
case evidenceParams =>
324324
val vparamss1 = meth.vparamss.reverse match {
325-
case (vparams @ (vparam :: _)) :: rvparamss if vparam.mods is ImplicitOrGiven =>
325+
case (vparams @ (vparam :: _)) :: rvparamss if vparam.mods.isOneOf(ImplicitOrGiven) =>
326326
((evidenceParams ++ vparams) :: rvparamss).reverse
327327
case _ =>
328328
meth.vparamss :+ evidenceParams
@@ -333,7 +333,7 @@ object desugar {
333333
/** The implicit evidence parameters of `meth`, as generated by `desugar.defDef` */
334334
private def evidenceParams(meth: DefDef)(implicit ctx: Context): List[ValDef] =
335335
meth.vparamss.reverse match {
336-
case (vparams @ (vparam :: _)) :: _ if vparam.mods is ImplicitOrGiven =>
336+
case (vparams @ (vparam :: _)) :: _ if vparam.mods.isOneOf(ImplicitOrGiven) =>
337337
vparams.dropWhile(!_.name.is(EvidenceParamName))
338338
case _ =>
339339
Nil
@@ -412,7 +412,7 @@ object desugar {
412412
if (isCaseClass && originalTparams.isEmpty)
413413
ctx.error(CaseClassMissingParamList(cdef), namePos)
414414
ListOfNil
415-
} else if (isCaseClass && originalVparamss.head.exists(_.mods.is(ImplicitOrGiven))) {
415+
} else if (isCaseClass && originalVparamss.head.exists(_.mods.isOneOf(ImplicitOrGiven))) {
416416
ctx.error("Case classes should have a non-implicit parameter list", namePos)
417417
ListOfNil
418418
}
@@ -507,7 +507,7 @@ object desugar {
507507
// new C[Ts](paramss)
508508
lazy val creatorExpr = {
509509
val vparamss = constrVparamss match {
510-
case (vparam :: _) :: _ if vparam.mods.is(ImplicitOrGiven) => // add a leading () to match class parameters
510+
case (vparam :: _) :: _ if vparam.mods.isOneOf(ImplicitOrGiven) => // add a leading () to match class parameters
511511
Nil :: constrVparamss
512512
case _ =>
513513
constrVparamss
@@ -657,7 +657,7 @@ object desugar {
657657
def widenedCreatorExpr =
658658
(creatorExpr /: widenDefs)((rhs, meth) => Apply(Ident(meth.name), rhs :: Nil))
659659
val applyMeths =
660-
if (mods is Abstract) Nil
660+
if (mods.is(Abstract)) Nil
661661
else {
662662
val copiedFlagsMask = DefaultParameterized | (copiedAccessFlags & Private)
663663
val appMods = {
@@ -702,9 +702,9 @@ object desugar {
702702
// synthetic implicit C[Ts](p11: T11, ..., p1N: T1N) ... (pM1: TM1, ..., pMN: TMN): C[Ts] =
703703
// new C[Ts](p11, ..., p1N) ... (pM1, ..., pMN) =
704704
val implicitWrappers =
705-
if (!mods.is(ImplicitOrImplied))
705+
if (!mods.isOneOf(ImplicitOrImplied))
706706
Nil
707-
else if (ctx.owner is Package) {
707+
else if (ctx.owner.is(Package)) {
708708
ctx.error(TopLevelImplicitClass(cdef), cdef.sourcePos)
709709
Nil
710710
}
@@ -791,7 +791,7 @@ object desugar {
791791
if (mods.is(Final) && !mods.is(Synthetic))
792792
ctx.warning(em"${hl("final")} modifier is redundant for objects", flagSourcePos(Final))
793793

794-
if (mods is Package)
794+
if (mods.is(Package))
795795
PackageDef(Ident(moduleName), cpy.ModuleDef(mdef)(nme.PACKAGE, impl).withMods(mods &~ Package) :: Nil)
796796
else if (isEnumCase) {
797797
typeParamIsReferenced(enumClass.typeParams, Nil, Nil, impl.parents)
@@ -1023,7 +1023,7 @@ object desugar {
10231023
val restDefs =
10241024
for (((named, tpt), n) <- vars.zipWithIndex if named.name != nme.WILDCARD)
10251025
yield
1026-
if (mods is Lazy) derivedDefDef(original, named, tpt, selector(n), mods &~ Lazy)
1026+
if (mods.is(Lazy)) derivedDefDef(original, named, tpt, selector(n), mods &~ Lazy)
10271027
else derivedValDef(original, named, tpt, selector(n), mods)
10281028
flatTree(firstDef :: restDefs)
10291029
}
@@ -1118,8 +1118,8 @@ object desugar {
11181118
def needsObject(stat: Tree) = stat match {
11191119
case _: ValDef | _: PatDef | _: DefDef | _: Export => true
11201120
case stat: ModuleDef =>
1121-
stat.mods.is(ImplicitOrImplied) || opaqueNames.contains(stat.name.stripModuleClassSuffix.toTypeName)
1122-
case stat: TypeDef => !stat.isClassDef || stat.mods.is(ImplicitOrImplied)
1121+
stat.mods.isOneOf(ImplicitOrImplied) || opaqueNames.contains(stat.name.stripModuleClassSuffix.toTypeName)
1122+
case stat: TypeDef => !stat.isClassDef || stat.mods.isOneOf(ImplicitOrImplied)
11231123
case _ => false
11241124
}
11251125
val (nestedStats, topStats) = pdef.stats.partition(needsObject)

compiler/src/dotty/tools/dotc/ast/TreeInfo.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ trait UntypedTreeInfo extends TreeInfo[Untyped] { self: Trees.Instance[Untyped]
296296
*/
297297
def lacksDefinition(mdef: MemberDef)(implicit ctx: Context): Boolean = mdef match {
298298
case mdef: ValOrDefDef =>
299-
mdef.unforcedRhs == EmptyTree && !mdef.name.isConstructorName && !mdef.mods.is(TermParamOrAccessor)
299+
mdef.unforcedRhs == EmptyTree && !mdef.name.isConstructorName && !mdef.mods.isOneOf(TermParamOrAccessor)
300300
case mdef: TypeDef =>
301301
def isBounds(rhs: Tree): Boolean = rhs match {
302302
case _: TypeBoundsTree => true
@@ -534,7 +534,7 @@ trait TypedTreeInfo extends TreeInfo[Type] { self: Trees.Instance[Type] =>
534534
*/
535535
def isVariableOrGetter(tree: Tree)(implicit ctx: Context): Boolean = {
536536
def sym = tree.symbol
537-
def isVar = sym is Mutable
537+
def isVar = sym.is(Mutable)
538538
def isGetter =
539539
mayBeVarGetter(sym) && sym.owner.info.member(sym.name.asTermName.setterName).exists
540540

@@ -652,7 +652,7 @@ trait TypedTreeInfo extends TreeInfo[Type] { self: Trees.Instance[Type] =>
652652
private def isSimpleThrowable(tp: Type)(implicit ctx: Context): Boolean = tp match {
653653
case tp @ TypeRef(pre, _) =>
654654
(pre == NoPrefix || pre.widen.typeSymbol.isStatic) &&
655-
(tp.symbol derivesFrom defn.ThrowableClass) && !(tp.symbol is Trait)
655+
(tp.symbol derivesFrom defn.ThrowableClass) && !tp.symbol.is(Trait)
656656
case _ =>
657657
false
658658
}
@@ -710,7 +710,7 @@ trait TypedTreeInfo extends TreeInfo[Type] { self: Trees.Instance[Type] =>
710710
else Nil
711711
case vdef: ValDef =>
712712
val sym = vdef.symbol
713-
assert(sym is Module)
713+
assert(sym.is(Module))
714714
if (cls == sym.companionClass || cls == sym.moduleClass) vdef :: Nil
715715
else Nil
716716
case tree =>

compiler/src/dotty/tools/dotc/ast/Trees.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ object Trees {
409409
// Denotation of a This tree is always the underlying class; needs correction for modules.
410410
override def denot(implicit ctx: Context): Denotation = {
411411
typeOpt match {
412-
case tpe @ TermRef(pre, _) if tpe.symbol is Module =>
412+
case tpe @ TermRef(pre, _) if tpe.symbol.is(Module) =>
413413
tpe.symbol.moduleClass.denot.asSeenFrom(pre)
414414
case _ =>
415415
super.denot
@@ -749,7 +749,7 @@ object Trees {
749749
def unforced: LazyTree = preRhs
750750
protected def force(x: AnyRef): Unit = preRhs = x
751751

752-
override def disableOverlapChecks = rawMods.is(Flags.Implied)
752+
override def disableOverlapChecks = rawMods.is(Implied)
753753
// disable order checks for implicit aliases since their given clause follows
754754
// their for clause, but the two appear swapped in the DefDef.
755755
}

compiler/src/dotty/tools/dotc/ast/tpd.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {
264264
def ClassDef(cls: ClassSymbol, constr: DefDef, body: List[Tree], superArgs: List[Tree] = Nil)(implicit ctx: Context): TypeDef = {
265265
val firstParent :: otherParents = cls.info.parents
266266
val superRef =
267-
if (cls is Trait) TypeTree(firstParent)
267+
if (cls.is(Trait)) TypeTree(firstParent)
268268
else {
269269
def isApplicable(ctpe: Type): Boolean = ctpe match {
270270
case ctpe: PolyType =>
@@ -285,7 +285,7 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {
285285
if (cls.classInfo.selfInfo ne NoType) ValDef(ctx.newSelfSym(cls))
286286
else EmptyValDef
287287
def isOwnTypeParam(stat: Tree) =
288-
(stat.symbol is TypeParam) && stat.symbol.owner == cls
288+
(stat.symbol.is(TypeParam)) && stat.symbol.owner == cls
289289
val bodyTypeParams = body filter isOwnTypeParam map (_.symbol)
290290
val newTypeParams =
291291
for (tparam <- cls.typeParams if !(bodyTypeParams contains tparam))
@@ -940,7 +940,7 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {
940940
*/
941941
def becomes(rhs: Tree)(implicit ctx: Context): Tree = {
942942
val sym = tree.symbol
943-
if (sym is Method) {
943+
if (sym.is(Method)) {
944944
val setter = sym.setter.orElse {
945945
assert(sym.name.isSetterName && sym.info.firstParamTypes.nonEmpty)
946946
sym
@@ -978,7 +978,7 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {
978978
* Returns true if the symbol is a val or def generated by eta-expansion/inline
979979
*/
980980
override protected def skipLocal(sym: Symbol): Boolean =
981-
sym.is(InlineProxy) || sym.is(Synthetic)
981+
sym.isOneOf(InlineProxy | Synthetic)
982982
}
983983
mapToUnderlying.transform(tree)
984984
}

compiler/src/dotty/tools/dotc/ast/untpd.scala

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,10 @@ object untpd extends Trees.Instance[Untyped] with UntypedTreeInfo {
179179
annotations: List[Tree] = Nil,
180180
mods: List[Mod] = Nil) {
181181

182-
def is(fs: FlagSet): Boolean = flags is fs
182+
def is(fs: FlagSet): Boolean = flags.is(fs)
183183
def is(fs: FlagSet, butNot: FlagSet): Boolean = flags.is(fs, butNot = butNot)
184+
def isOneOf(fs: FlagSet): Boolean = flags.isOneOf(fs)
185+
def isOneOf(fs: FlagSet, butNot: FlagSet): Boolean = flags.isOneOf(fs, butNot = butNot)
184186
def isAll(fc: FlagConjunction): Boolean = flags.isAll(fc)
185187

186188
def | (fs: FlagSet): Modifiers = withFlags(flags | fs)
@@ -206,7 +208,7 @@ object untpd extends Trees.Instance[Untyped] with UntypedTreeInfo {
206208
else {
207209
if (ms.nonEmpty)
208210
for (m <- ms)
209-
assert(flags.is(m.flags) ||
211+
assert(flags.isAll(allOf(m.flags)) ||
210212
m.isInstanceOf[Mod.Private] && !privateWithin.isEmpty,
211213
s"unaccounted modifier: $m in $this when adding $ms")
212214
copy(mods = ms)

compiler/src/dotty/tools/dotc/core/CheckRealizable.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ object CheckRealizable {
4747
def boundsRealizability(tp: Type)(implicit ctx: Context): Realizability =
4848
new CheckRealizable().boundsRealizability(tp)
4949

50-
private val LateInitialized = Lazy | Erased
50+
private val LateInitializedFlags = Lazy | Erased
5151
}
5252

5353
/** Compute realizability status.
@@ -70,7 +70,7 @@ class CheckRealizable(implicit ctx: Context) {
7070
/** Is symbol's definitition a lazy or erased val?
7171
* (note we exclude modules here, because their realizability is ensured separately)
7272
*/
73-
private def isLateInitialized(sym: Symbol) = sym.is(LateInitialized, butNot = Module)
73+
private def isLateInitialized(sym: Symbol) = sym.isOneOf(LateInitializedFlags, butNot = Module)
7474

7575
/** The realizability status of given type `tp`*/
7676
def realizability(tp: Type): Realizability = tp.dealias match {
@@ -190,7 +190,7 @@ class CheckRealizable(implicit ctx: Context) {
190190
private def memberRealizability(tp: Type) = {
191191
def checkField(sofar: Realizability, fld: SingleDenotation): Realizability =
192192
sofar andAlso {
193-
if (checkedFields.contains(fld.symbol) || fld.symbol.is(Private | Mutable | LateInitialized))
193+
if (checkedFields.contains(fld.symbol) || fld.symbol.isOneOf(Private | Mutable | LateInitializedFlags))
194194
// if field is private it cannot be part of a visible path
195195
// if field is mutable it cannot be part of a path
196196
// if field is lazy or erased it does not need to be initialized when the owning object is

0 commit comments

Comments
 (0)