Skip to content

Commit 363b7f4

Browse files
committed
Use Implicit flag unions where possible
1 parent c6be8f0 commit 363b7f4

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ object desugar {
161161
vparamss = (setterParam :: Nil) :: Nil,
162162
tpt = TypeTree(defn.UnitType),
163163
rhs = setterRhs
164-
).withMods((mods | Accessor) &~ (CaseAccessor | Implicit | Given | Lazy))
164+
).withMods((mods | Accessor) &~ (CaseAccessor | ImplicitOrGiven | Lazy))
165165
Thicket(vdef, setter)
166166
}
167167
else vdef

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ object Flags {
462462

463463
/** Flags representing source modifiers */
464464
private val CommonSourceModifierFlags: FlagSet =
465-
commonFlags(Private, Protected, Final, Case, Implicit, Implied, Given, Override, JavaStatic)
465+
commonFlags(Private, Protected, Final, Case, ImplicitOrImpliedOrGiven, Override, JavaStatic)
466466

467467
final val TypeSourceModifierFlags: FlagSet =
468468
CommonSourceModifierFlags.toTypeFlags | Abstract | Sealed | Opaque
@@ -487,7 +487,7 @@ object Flags {
487487
HigherKinded.toCommonFlags | Param | ParamAccessor.toCommonFlags |
488488
Scala2ExistentialCommon | MutableOrOpaque | Touched | JavaStatic |
489489
CovariantOrOuter | ContravariantOrLabel | CaseAccessor.toCommonFlags |
490-
Extension.toCommonFlags | NonMember | Implicit | Given | Implied | Permanent | Synthetic |
490+
Extension.toCommonFlags | NonMember | ImplicitOrImpliedOrGiven | Permanent | Synthetic |
491491
SuperAccessorOrScala2x | Inline
492492

493493
/** Flags that are not (re)set when completing the denotation, or, if symbol is
@@ -543,7 +543,7 @@ object Flags {
543543

544544
/** Flags that can apply to a module val */
545545
final val RetainedModuleValFlags: FlagSet = RetainedModuleValAndClassFlags |
546-
Override | Final | Method | Implicit | Implied | Lazy |
546+
Override | Final | Method | ImplicitOrImplied | Lazy |
547547
Accessor | AbsOverride | StableRealizable | Captured | Synchronized | Erased
548548

549549
/** Flags that can apply to a module class */

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -789,7 +789,7 @@ object Types {
789789
}
790790

791791
/** The set of implicit term members of this type
792-
* @param kind A subset of {Implicit, Implied} that sepcifies what kind of implicit should
792+
* @param kind A subset of {Implicit, Implied} that specifies what kind of implicit should
793793
* be returned
794794
*/
795795
final def implicitMembers(kind: FlagSet)(implicit ctx: Context): List[TermRef] = track("implicitMembers") {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ object Implicits {
230230
assert(initctx.typer != null)
231231
lazy val refs: List[ImplicitRef] = {
232232
val buf = new mutable.ListBuffer[TermRef]
233-
for (companion <- companionRefs) buf ++= companion.implicitMembers(ImplicitOrImplied)
233+
for (companion <- companionRefs) buf ++= companion.implicitMembers(ImplicitOrImpliedOrGiven)
234234
buf.toList
235235
}
236236

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -988,7 +988,7 @@ class Namer { typer: Typer =>
988988
val maybeStable = if (mbr.symbol.isStableMember) StableRealizable else EmptyFlags
989989
ctx.newSymbol(
990990
cls, alias,
991-
Exported | Method | Final | maybeStable | mbr.symbol.flags & ImplicitOrImplied,
991+
Exported | Method | Final | maybeStable | mbr.symbol.flags & ImplicitOrImpliedOrGiven,
992992
mbr.info.ensureMethodic,
993993
coord = span)
994994
}

0 commit comments

Comments
 (0)