Skip to content

Commit be65f09

Browse files
committed
Optimization: reduce creations of FlagConjunction
1 parent e46529f commit be65f09

File tree

4 files changed

+5
-3
lines changed

4 files changed

+5
-3
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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.is(Flags.allOf(Flags.Method, Flags.Lifted))
480+
|| sym.is(Flags.LiftedMethod)
481481
|| sym.is(Flags.Bridge)
482482
)
483483

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -698,6 +698,8 @@ object Flags {
698698
/** Labeled protected[this] */
699699
final val ProtectedLocal: FlagConjunction = allOf(Protected, Local)
700700

701+
final val LiftedMethod: FlagConjunction = allOf(Lifted, Method)
702+
701703
/** Java symbol which is `protected` and `static` */
702704
final val StaticProtected: FlagConjunction = allOf(JavaDefined, Protected, JavaStatic)
703705

compiler/src/dotty/tools/dotc/typer/Applications.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1159,7 +1159,7 @@ trait Applications extends Compatibility { self: Typer with Dynamic =>
11591159
* result matching `resultType`?
11601160
*/
11611161
def hasExtensionMethod(tp: Type, name: TermName, argType: Type, resultType: Type)(implicit ctx: Context) = {
1162-
val mbr = tp.memberBasedOnFlags(name, required = allOf(ExtensionMethod))
1162+
val mbr = tp.memberBasedOnFlags(name, required = ExtensionMethod)
11631163
mbr.exists && isApplicable(tp.select(name, mbr), argType :: Nil, resultType)
11641164
}
11651165

compiler/src/dotty/tools/dotc/typer/Implicits.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ object Implicits {
143143
tpw.derivesFrom(defn.Predef_Conforms) && ref.symbol != defn.Predef_conforms
144144
val hasExtensions = resType match {
145145
case SelectionProto(name, _, _, _) =>
146-
tpw.memberBasedOnFlags(name, required = allOf(ExtensionMethod)).exists
146+
tpw.memberBasedOnFlags(name, required = ExtensionMethod).exists
147147
case _ => false
148148
}
149149
val conversionKind =

0 commit comments

Comments
 (0)