Skip to content

Commit f312023

Browse files
committed
Rename isAll -> isAllOf
Also rename SymDenotaton.is(_, _) to isAllOf
1 parent 51814b0 commit f312023

40 files changed

+68
-68
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ class DottyBackendInterface(outputDirectory: AbstractFile, val superCallsMap: Ma
256256
case t: TypeApply if (t.fun.symbol == Predef_classOf) =>
257257
av.visit(name, t.args.head.tpe.classSymbol.denot.info.toTypeKind(bcodeStore)(innerClasesStore).toASMType)
258258
case t: tpd.RefTree =>
259-
if (t.symbol.denot.owner.isAll(Flags.JavaEnum)) {
259+
if (t.symbol.denot.owner.isAllOf(Flags.JavaEnum)) {
260260
val edesc = innerClasesStore.typeDescriptor(t.tpe.asInstanceOf[bcodeStore.int.Type]) // the class descriptor of the enumeration class.
261261
val evalue = t.symbol.name.mangledString // value the actual enumeration value.
262262
av.visitEnum(name, edesc, evalue)
@@ -477,7 +477,7 @@ class DottyBackendInterface(outputDirectory: AbstractFile, val superCallsMap: Ma
477477
// unrelated change.
478478
ctx.base.settings.YnoGenericSig.value
479479
|| sym.is(Flags.Artifact)
480-
|| sym.isAll(Flags.LiftedMethod)
480+
|| sym.isAllOf(Flags.LiftedMethod)
481481
|| sym.is(Flags.Bridge)
482482
)
483483

@@ -689,13 +689,13 @@ class DottyBackendInterface(outputDirectory: AbstractFile, val superCallsMap: Ma
689689
def isBottomClass: Boolean = (sym ne defn.NullClass) && (sym ne defn.NothingClass)
690690
def isBridge: Boolean = sym.is(Flags.Bridge)
691691
def isArtifact: Boolean = sym.is(Flags.Artifact)
692-
def hasEnumFlag: Boolean = sym.isAll(Flags.JavaEnum)
692+
def hasEnumFlag: Boolean = sym.isAllOf(Flags.JavaEnum)
693693
def hasAccessBoundary: Boolean = sym.accessBoundary(defn.RootClass) ne defn.RootClass
694694
def isVarargsMethod: Boolean = sym.is(Flags.JavaVarargs)
695695
def isDeprecated: Boolean = false
696696
def isMutable: Boolean = sym.is(Flags.Mutable)
697697
def hasAbstractFlag: Boolean =
698-
(sym.is(Flags.Abstract)) || (sym.isAll(Flags.JavaInterface)) || (sym.is(Flags.Trait))
698+
(sym.is(Flags.Abstract)) || (sym.isAllOf(Flags.JavaInterface)) || (sym.is(Flags.Trait))
699699
def hasModuleFlag: Boolean = sym.is(Flags.Module)
700700
def isSynchronized: Boolean = sym.is(Flags.Synchronized)
701701
def isNonBottomSubClass(other: Symbol): Boolean = sym.derivesFrom(other)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ object desugar {
159159
val vdef @ ValDef(name, tpt, rhs) = transformQuotedPatternName(vdef0)
160160
val mods = vdef.mods
161161
val setterNeeded =
162-
mods.is(Mutable) && ctx.owner.isClass && (!mods.isAll(PrivateLocal) || ctx.owner.is(Trait))
162+
mods.is(Mutable) && ctx.owner.isClass && (!mods.isAllOf(PrivateLocal) || ctx.owner.is(Trait))
163163
if (setterNeeded) {
164164
// TODO: copy of vdef as getter needed?
165165
// val getter = ValDef(mods, name, tpt, rhs) withPos vdef.pos?

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ object untpd extends Trees.Instance[Untyped] with UntypedTreeInfo {
187187
def is(fs: FlagSet, butNot: FlagSet): Boolean = flags.is(fs, butNot = butNot)
188188
def isOneOf(fs: FlagSet): Boolean = flags.isOneOf(fs)
189189
def isOneOf(fs: FlagSet, butNot: FlagSet): Boolean = flags.isOneOf(fs, butNot = butNot)
190-
def isAll(fc: FlagConjunction): Boolean = flags.isAll(fc)
190+
def isAllOf(fc: FlagConjunction): Boolean = flags.isAllOf(fc)
191191

192192
def | (fs: FlagSet): Modifiers = withFlags(flags | fs)
193193
def & (fs: FlagSet): Modifiers = withFlags(flags & fs)
@@ -217,7 +217,7 @@ object untpd extends Trees.Instance[Untyped] with UntypedTreeInfo {
217217
else {
218218
if (ms.nonEmpty)
219219
for (m <- ms)
220-
assert(flags.isAll(allOf(m.flags)) ||
220+
assert(flags.isAllOf(allOf(m.flags)) ||
221221
m.isInstanceOf[Mod.Private] && !privateWithin.isEmpty,
222222
s"unaccounted modifier: $m in $this when adding $ms")
223223
copy(mods = ms)

compiler/src/dotty/tools/dotc/config/JavaPlatform.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class JavaPlatform extends Platform {
3939

4040
/** Is the SAMType `cls` also a SAM under the rules of the JVM? */
4141
def isSam(cls: ClassSymbol)(implicit ctx: Context): Boolean =
42-
cls.isAll(NoInitsTrait) &&
42+
cls.isAllOf(NoInitsTrait) &&
4343
cls.superClass == defn.ObjectClass &&
4444
cls.directlyInheritedTraits.forall(_.is(NoInits)) &&
4545
!ExplicitOuter.needsOuterIfReferenced(cls) &&

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1152,7 +1152,7 @@ object Denotations {
11521152
case symd: SymDenotation => symd
11531153
case _ => symbol.denot
11541154
}
1155-
symd.isAll(required) && !symd.isOneOf(excluded)
1155+
symd.isAllOf(required) && !symd.isOneOf(excluded)
11561156
}
11571157
}
11581158

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ object Flags {
6464
/** Does this flag set have all of the flags in given flag conjunction?
6565
* Pre: The intersection of the typeflags of both sets must be non-empty.
6666
*/
67-
def isAll(flags: FlagConjunction): Boolean = {
67+
def isAllOf(flags: FlagConjunction): Boolean = {
6868
val fs = bits & flags.bits
6969
((fs & KINDFLAGS) != 0 || flags.bits == 0) &&
7070
(fs >>> TYPESHIFT) == (flags.bits >>> TYPESHIFT)
@@ -74,7 +74,7 @@ object Flags {
7474
* and at the same time contain none of the flags in the `butNot` set?
7575
* Pre: The intersection of the typeflags of both sets must be non-empty.
7676
*/
77-
def isAll(flags: FlagConjunction, butNot: FlagSet): Boolean = isAll(flags) && !is(butNot)
77+
def isAllOf(flags: FlagConjunction, butNot: FlagSet): Boolean = isAllOf(flags) && !is(butNot)
7878

7979
def isEmpty: Boolean = (bits & ~KINDFLAGS) == 0
8080

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -207,14 +207,14 @@ object SymDenotations {
207207
(if (isCurrent(fs) && isCurrent(butNot)) myFlags else flags).isOneOf(fs, butNot)
208208

209209
/** Has this denotation all of the flags in `fs` set? */
210-
final def isAll(fs: FlagConjunction)(implicit ctx: Context): Boolean =
211-
(if (isCurrent(fs.toFlags)) myFlags else flags).isAll(fs)
210+
final def isAllOf(fs: FlagConjunction)(implicit ctx: Context): Boolean =
211+
(if (isCurrent(fs.toFlags)) myFlags else flags).isAllOf(fs)
212212

213213
/** Has this denotation all of the flags in `fs` set, whereas none of the flags
214214
* in `butNot` are set?
215215
*/
216-
final def is(fs: FlagConjunction, butNot: FlagSet)(implicit ctx: Context): Boolean =
217-
(if (isCurrent(fs.toFlags) && isCurrent(butNot)) myFlags else flags).isAll(fs, butNot)
216+
final def isAllOf(fs: FlagConjunction, butNot: FlagSet)(implicit ctx: Context): Boolean =
217+
(if (isCurrent(fs.toFlags) && isCurrent(butNot)) myFlags else flags).isAllOf(fs, butNot)
218218

219219
/** The type info, or, if symbol is not yet completed, the completer */
220220
final def infoOrCompleter: Type = myInfo
@@ -848,7 +848,7 @@ object SymDenotations {
848848
def isSkolem: Boolean = name == nme.SKOLEM
849849

850850
def isInlineMethod(implicit ctx: Context): Boolean =
851-
is(InlineMethod, butNot = Accessor) &&
851+
isAllOf(InlineMethod, butNot = Accessor) &&
852852
!name.isUnapplyName // unapply methods do not count as inline methods
853853
// we need an inline flag on them only do that
854854
// reduceProjection gets access to their rhs
@@ -1245,7 +1245,7 @@ object SymDenotations {
12451245
final def accessBoundary(base: Symbol)(implicit ctx: Context): Symbol = {
12461246
val fs = flags
12471247
if (fs.is(Private)) owner
1248-
else if (fs.isAll(StaticProtected)) defn.RootClass
1248+
else if (fs.isAllOf(StaticProtected)) defn.RootClass
12491249
else if (privateWithin.exists && !ctx.phase.erasedTypes) privateWithin
12501250
else if (fs.is(Protected)) base
12511251
else defn.RootClass

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ object Types {
235235
* from the ThisType of `symd`'s owner.
236236
*/
237237
def isArgPrefixOf(symd: SymDenotation)(implicit ctx: Context): Boolean =
238-
symd.isAll(ClassTypeParam) && {
238+
symd.isAllOf(ClassTypeParam) && {
239239
this match {
240240
case tp: ThisType => tp.cls ne symd.owner
241241
case _ => true
@@ -2149,7 +2149,7 @@ object Types {
21492149
else {
21502150
if (isType) {
21512151
val res =
2152-
if (currentSymbol.isAll(ClassTypeParam)) argForParam(prefix)
2152+
if (currentSymbol.isAllOf(ClassTypeParam)) argForParam(prefix)
21532153
else prefix.lookupRefined(name)
21542154
if (res.exists) return res
21552155
if (Config.splitProjections)
@@ -4375,7 +4375,7 @@ object Types {
43754375
// (x: String): Int
43764376
val approxParams = new ApproximatingTypeMap {
43774377
def apply(tp: Type): Type = tp match {
4378-
case tp: TypeRef if tp.symbol.isAll(ClassTypeParam) && tp.symbol.owner == cls =>
4378+
case tp: TypeRef if tp.symbol.isAllOf(ClassTypeParam) && tp.symbol.owner == cls =>
43794379
tp.info match {
43804380
case info: AliasingBounds =>
43814381
mapOver(info.alias)
@@ -4717,7 +4717,7 @@ object Types {
47174717
else pre match {
47184718
case Range(preLo, preHi) =>
47194719
val forwarded =
4720-
if (tp.symbol.isAll(ClassTypeParam)) expandParam(tp, preHi)
4720+
if (tp.symbol.isAllOf(ClassTypeParam)) expandParam(tp, preHi)
47214721
else tryWiden(tp, preHi)
47224722
forwarded.orElse(
47234723
range(super.derivedSelect(tp, preLo).loBound, super.derivedSelect(tp, preHi).hiBound))

compiler/src/dotty/tools/dotc/core/classfile/ClassfileParser.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,7 @@ class ClassfileParser(
583583
parseExceptions(attrLen)
584584

585585
case tpnme.CodeATTR =>
586-
if (sym.owner.isAll(Flags.JavaTrait)) {
586+
if (sym.owner.isAllOf(Flags.JavaTrait)) {
587587
sym.resetFlag(Flags.Deferred)
588588
sym.owner.resetFlag(Flags.PureInterface)
589589
ctx.log(s"$sym in ${sym.owner} is a java8+ default method.")

compiler/src/dotty/tools/dotc/core/unpickleScala2/Scala2Unpickler.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ object Scala2Unpickler {
120120
if (tsym.exists) tsym.setFlag(TypeParam)
121121
else denot.enter(tparam, decls)
122122
}
123-
if (!denot.flagsUNSAFE.isAll(JavaModule)) ensureConstructor(denot.symbol.asClass, decls)
123+
if (!denot.flagsUNSAFE.isAllOf(JavaModule)) ensureConstructor(denot.symbol.asClass, decls)
124124

125125
val scalacCompanion = denot.classSymbol.scalacLinkedClass
126126

@@ -436,7 +436,7 @@ class Scala2Unpickler(bytes: Array[Byte], classRoot: ClassDenotation, moduleClas
436436
val owner = readSymbolRef()
437437

438438
var flags = unpickleScalaFlags(readLongNat(), name.isTypeName)
439-
if (flags.isAll(DefaultParameter)) {
439+
if (flags.isAllOf(DefaultParameter)) {
440440
// DefaultParameterized flag now on method, not parameter
441441
//assert(flags.is(Param), s"$name0 in $owner")
442442
flags = flags &~ DefaultParameterized

0 commit comments

Comments
 (0)