Skip to content

Commit ebb3b9a

Browse files
committed
Drop ImplicitCommon flag
Align with usage elsewhere where a flag name normally applies to both terms and types, and is qualified with Term or Type if we want only one half.
1 parent 8739bbc commit ebb3b9a

File tree

4 files changed

+10
-8
lines changed

4 files changed

+10
-8
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,9 @@ object untpd extends Trees.Instance[Untyped] with UntypedTreeInfo {
130130

131131
case class Var()(implicit @constructorOnly src: SourceFile) extends Mod(Flags.Mutable)
132132

133-
case class Implicit()(implicit @constructorOnly src: SourceFile) extends Mod(Flags.ImplicitCommon)
133+
case class Implicit()(implicit @constructorOnly src: SourceFile) extends Mod(Flags.Implicit)
134134

135-
case class Given()(implicit @constructorOnly src: SourceFile) extends Mod(Flags.ImplicitCommon | Flags.Given)
135+
case class Given()(implicit @constructorOnly src: SourceFile) extends Mod(Flags.Implicit | Flags.Given)
136136

137137
case class Erased()(implicit @constructorOnly src: SourceFile) extends Mod(Flags.Erased)
138138

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -242,8 +242,8 @@ object Flags {
242242
final val TypeParam: FlagSet = Param.toTypeFlags
243243

244244
/** Labeled with `implicit` modifier (implicit value) */
245-
final val ImplicitCommon: FlagSet = commonFlag(9, "implicit")
246-
final val Implicit: FlagSet = ImplicitCommon.toTermFlags
245+
final val Implicit: FlagSet = commonFlag(9, "implicit")
246+
final val ImplicitTerm: FlagSet = Implicit.toTermFlags
247247

248248
/** Labeled with `lazy` (a lazy val). */
249249
final val Lazy: FlagSet = termFlag(10, "lazy")
@@ -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 | ImplicitCommon | Implied | Permanent | Synthetic |
490+
Extension.toCommonFlags | NonMember | Implicit | Implied | Permanent | Synthetic |
491491
SuperAccessorOrScala2x | Inline
492492

493493
/** Flags that are not (re)set when completing the denotation, or, if symbol is
@@ -590,6 +590,8 @@ object Flags {
590590

591591
final val ImplicitOrImplied = Implicit | Implied
592592

593+
final val ImplicitOrImpliedTerm = ImplicitOrImplied.toTermFlags
594+
593595
/** Assumed to be pure */
594596
final val StableOrErased: FlagSet = StableRealizable | Erased
595597

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -787,10 +787,10 @@ object Types {
787787
(name, buf) => buf += member(name).asSingleDenotation)
788788
}
789789

790-
/** The set of implicit members of this type */
790+
/** The set of implicit term members of this type */
791791
final def implicitMembers(implicit ctx: Context): List[TermRef] = track("implicitMembers") {
792792
memberDenots(implicitFilter,
793-
(name, buf) => buf ++= member(name).altsWith(_ is ImplicitOrImplied))
793+
(name, buf) => buf ++= member(name).altsWith(_.is(ImplicitOrImpliedTerm)))
794794
.toList.map(d => TermRef(this, d.symbol.asTerm))
795795
}
796796

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ object Checking {
376376
))
377377
fail(ParamsNoInline(sym.owner))
378378

379-
if (sym.is(ImplicitCommon | Implied)) {
379+
if (sym.is(ImplicitOrImplied)) {
380380
if (sym.owner.is(Package))
381381
fail(TopLevelCantBeImplicit(sym))
382382
if (sym.isType)

0 commit comments

Comments
 (0)