Skip to content

Commit 2d26955

Browse files
committed
Rename Implicit flag to OldImplicit
1 parent de8d161 commit 2d26955

File tree

17 files changed

+53
-45
lines changed

17 files changed

+53
-45
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ object desugar {
207207
val epbuf = new ListBuffer[ValDef]
208208
def desugarContextBounds(rhs: Tree): Tree = rhs match {
209209
case ContextBounds(tbounds, cxbounds) =>
210-
epbuf ++= makeImplicitParameters(cxbounds, Implicit, forPrimaryConstructor = isPrimaryConstructor)
210+
epbuf ++= makeImplicitParameters(cxbounds, OldImplicit, forPrimaryConstructor = isPrimaryConstructor)
211211
tbounds
212212
case LambdaTypeTree(tparams, body) =>
213213
cpy.LambdaTypeTree(rhs)(tparams, desugarContextBounds(body))

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {
232232
def valueParam(name: TermName, origInfo: Type): TermSymbol = {
233233
val maybeImplicit =
234234
if (tp.isContextual) Given
235-
else if (tp.isImplicitMethod) Implicit
235+
else if (tp.isImplicitMethod) OldImplicit
236236
else EmptyFlags
237237
val maybeErased = if (tp.isErasedMethod) Erased else EmptyFlags
238238

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ object untpd extends Trees.Instance[Untyped] with UntypedTreeInfo {
132132

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

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

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

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

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

245245
/** Labeled with `implicit` modifier (implicit value) */
246-
final val Implicit: FlagSet = commonFlag(9, "implicit")
247-
final val ImplicitTerm: FlagSet = Implicit.toTermFlags
246+
final val OldImplicit: FlagSet = commonFlag(9, "implicit")
247+
final val OldImplicitTerm: FlagSet = OldImplicit.toTermFlags
248248

249249
/** Labeled with `lazy` (a lazy val). */
250250
final val Lazy: FlagSet = termFlag(10, "lazy")
@@ -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, OldImplicit, Implied, Given, 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 | OldImplicit | Given | Implied | 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 | OldImplicit | Implied | Lazy |
547547
Accessor | AbsOverride | StableRealizable | Captured | Synchronized | Erased
548548

549549
/** Flags that can apply to a module class */
@@ -588,9 +588,9 @@ object Flags {
588588
/** An inline method or inline argument proxy */
589589
final val InlineOrProxy: FlagSet = Inline | InlineProxy
590590

591-
final val ImplicitOrImplied = Implicit | Implied
592-
final val ImplicitOrImpliedOrGiven = Implicit | Implied | Given
593-
final val ImplicitOrGiven = Implicit | Given
591+
final val ImplicitOrImplied = OldImplicit | Implied
592+
final val ImplicitOrImpliedOrGiven = OldImplicit | Implied | Given
593+
final val ImplicitOrGiven = OldImplicit | Given
594594

595595
final val ImplicitOrImpliedOrGivenTerm = ImplicitOrImpliedOrGiven.toTermFlags
596596

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 specifies what kind of implicit should
792+
* @param kind A subset of {OldImplicit, 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/core/tasty/TreePickler.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -643,7 +643,7 @@ class TreePickler(pickler: TastyPickler) {
643643
if (flags is Artifact) writeByte(ARTIFACT)
644644
if (flags is Scala2x) writeByte(SCALA2X)
645645
if (isTerm) {
646-
if (flags is Implicit) writeByte(IMPLICIT)
646+
if (flags is OldImplicit) writeByte(IMPLICIT)
647647
if (flags is Implied) writeByte(IMPLIED)
648648
if (flags is Erased) writeByte(ERASED)
649649
if (flags.is(Lazy, butNot = Module)) writeByte(LAZY)

compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,7 @@ class TreeUnpickler(reader: TastyReader,
606606
case FINAL => addFlag(Final)
607607
case SEALED => addFlag(Sealed)
608608
case CASE => addFlag(Case)
609-
case IMPLICIT => addFlag(Implicit)
609+
case IMPLICIT => addFlag(OldImplicit)
610610
case IMPLIED => addFlag(Implied)
611611
case ERASED => addFlag(Erased)
612612
case LAZY => addFlag(Lazy)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ object PickleBuffer {
205205
METHOD_PKL -> Method,
206206
INTERFACE_PKL -> NoInitsInterface,
207207
MODULE_PKL -> (Module | Lazy, Module),
208-
IMPLICIT_PKL -> Implicit,
208+
IMPLICIT_PKL -> OldImplicit,
209209
SEALED_PKL -> Sealed,
210210
CASE_PKL -> Case,
211211
MUTABLE -> Mutable,

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -767,10 +767,10 @@ class Scala2Unpickler(bytes: Array[Byte], classRoot: ClassDenotation, moduleClas
767767
case METHODtpe | IMPLICITMETHODtpe =>
768768
val restpe = readTypeRef()
769769
val params = until(end, () => readSymbolRef())
770-
def isImplicit =
770+
def isOldImplicit =
771771
tag == IMPLICITMETHODtpe ||
772-
params.nonEmpty && (params.head is Implicit)
773-
val maker = MethodType.maker(isImplicit = isImplicit)
772+
params.nonEmpty && (params.head is OldImplicit)
773+
val maker = MethodType.maker(isImplicit = isOldImplicit)
774774
maker.fromSymbols(params, restpe)
775775
case POLYtpe =>
776776
val restpe = readTypeRef()

compiler/src/dotty/tools/dotc/parsing/Parsers.scala

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1414,7 +1414,7 @@ object Parsers {
14141414
case _ =>
14151415
}
14161416
imods.mods match {
1417-
case Mod.Implicit() :: mods => markFirstIllegal(mods)
1417+
case Mod.OldImplicit() :: mods => markFirstIllegal(mods)
14181418
case mods => markFirstIllegal(mods)
14191419
}
14201420
val result @ Match(t, cases) =
@@ -1933,7 +1933,7 @@ object Parsers {
19331933
private def modOfToken(tok: Int, name: Name): Mod = tok match {
19341934
case ABSTRACT => Mod.Abstract()
19351935
case FINAL => Mod.Final()
1936-
case IMPLICIT => Mod.Implicit()
1936+
case IMPLICIT => Mod.OldImplicit()
19371937
case GIVEN => Mod.Given()
19381938
case ERASED => Mod.Erased()
19391939
case LAZY => Mod.Lazy()
@@ -2197,7 +2197,7 @@ object Parsers {
21972197
if (in.token == RPAREN && !prefix && !impliedMods.is(Given)) Nil
21982198
else {
21992199
if (in.token == IMPLICIT && !impliedMods.is(Given | Erased))
2200-
impliedMods = addMod(impliedMods, atSpan(accept(IMPLICIT)) { Mod.Implicit() })
2200+
impliedMods = addMod(impliedMods, atSpan(accept(IMPLICIT)) { Mod.OldImplicit() })
22012201
val clause =
22022202
if (prefix) param() :: Nil
22032203
else commaSeparated(() => param())
@@ -2247,7 +2247,7 @@ object Parsers {
22472247
ofCaseClass = ofCaseClass,
22482248
firstClause = firstClause,
22492249
initialMods = initialMods)
2250-
val lastClause = params.nonEmpty && params.head.mods.flags.is(Implicit)
2250+
val lastClause = params.nonEmpty && params.head.mods.flags.is(OldImplicit)
22512251
params :: (if (lastClause) Nil else recur(firstClause = false, nparams + params.length))
22522252
}
22532253
else if (isContextual) {
@@ -2586,9 +2586,9 @@ object Parsers {
25862586
enumDef(start, mods, atSpan(in.skipToken()) { Mod.Enum() })
25872587
case _ =>
25882588
mods.mods.lastOption match {
2589-
case Some(impl @ Mod.Implicit()) =>
2590-
val strippedMods = mods.withFlags(mods.flags &~ Implicit).withMods(mods.mods.init)
2591-
instanceDef(start, addMod(strippedMods, Mod.Instance().withSpan(impl.span)))
2589+
case Some(old @ Mod.OldImplicit()) =>
2590+
val strippedMods = mods.withFlags(mods.flags &~ OldImplicit).withMods(mods.mods.init)
2591+
instanceDef(start, addMod(strippedMods, Mod.Instance().withSpan(old.span)))
25922592
case _ =>
25932593
syntaxErrorOrIncomplete(ExpectedStartOfTopLevelDefinition())
25942594
EmptyTree
@@ -3012,7 +3012,7 @@ object Parsers {
30123012
var imods = modifiers(closureMods)
30133013
if (isBindingIntro)
30143014
stats += implicitClosure(start, Location.InBlock, imods)
3015-
else if (in.token == MATCH && imods.mods == Mod.Implicit() :: Nil)
3015+
else if (in.token == MATCH && imods.mods == Mod.OldImplicit() :: Nil)
30163016
stats += implicitMatch(start, imods)
30173017
else
30183018
stats +++= localDef(start, imods)

0 commit comments

Comments
 (0)