Skip to content

Commit d3dddbc

Browse files
committed
Rename: Stable -> StableRealizable
1 parent af4ccf9 commit d3dddbc

14 files changed

+20
-20
lines changed

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ class CheckRealizable(implicit ctx: Context) {
6969
case tp: TermRef =>
7070
val sym = tp.symbol
7171
lazy val tpInfoRealizable = realizability(tp.info)
72-
if (sym.is(Stable)) realizability(tp.prefix)
72+
if (sym.is(StableRealizable)) realizability(tp.prefix)
7373
else {
7474
val r =
7575
if (sym.isStable && !isLateInitialized(sym))
@@ -83,7 +83,7 @@ class CheckRealizable(implicit ctx: Context) {
8383
// roughly: it's realizable if the info does not have bad bounds
8484
tpInfoRealizable.mapError(r => new ProblemInUnderlying(tp, r))
8585
r andAlso {
86-
if (sym.isStable) sym.setFlag(Stable) // it's known to be stable and realizable
86+
if (sym.isStable) sym.setFlag(StableRealizable) // it's known to be stable and realizable
8787
realizability(tp.prefix)
8888
} mapError { r =>
8989
if (tp.info.isStable && tpInfoRealizable == Realizable) Realizable else r

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

+6-6
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ object Flags {
329329
final val Abstract: FlagSet = commonFlag(23, "abstract")
330330

331331
/** Lazy val or method is known or assumed to be stable and realizable */
332-
final val Stable: FlagSet = termFlag(24, "<stable>")
332+
final val StableRealizable: FlagSet = termFlag(24, "<stable>")
333333

334334
/** A case parameter accessor */
335335
final val CaseAccessor: FlagSet = termFlag(25, "<caseaccessor>")
@@ -506,7 +506,7 @@ object Flags {
506506
final val RetainedTypeArgFlags: FlagSet = VarianceFlags | Protected | Local
507507

508508
/** Modules always have these flags set */
509-
final val ModuleValCreationFlags: FlagSet = ModuleVal | Lazy | Final | Stable
509+
final val ModuleValCreationFlags: FlagSet = ModuleVal | Lazy | Final | StableRealizable
510510

511511
/** Module classes always have these flags set */
512512
final val ModuleClassCreationFlags: FlagSet = ModuleClass | Final
@@ -537,7 +537,7 @@ object Flags {
537537
/** Flags that can apply to a module val */
538538
final val RetainedModuleValFlags: FlagSet = RetainedModuleValAndClassFlags |
539539
Override | Final | Method | Implicit | Lazy |
540-
Accessor | AbsOverride | Stable | Captured | Synchronized | Erased
540+
Accessor | AbsOverride | StableRealizable | Captured | Synchronized | Erased
541541

542542
/** Flags that can apply to a module class */
543543
final val RetainedModuleClassFlags: FlagSet = RetainedModuleValAndClassFlags |
@@ -582,7 +582,7 @@ object Flags {
582582
final val InlineOrProxy: FlagSet = Inline | InlineProxy
583583

584584
/** Assumed to be pure */
585-
final val StableOrErased: FlagSet = Stable | Erased
585+
final val StableOrErased: FlagSet = StableRealizable | Erased
586586

587587
/** Labeled `private`, `final`, or `inline` */
588588
final val EffectivelyFinal: FlagSet = Private | Final | Inline
@@ -675,7 +675,7 @@ object Flags {
675675
final val JavaEnumTrait: FlagConjunction = allOf(JavaDefined, Enum)
676676

677677
/** A Java enum value */
678-
final val JavaEnumValue: FlagConjunction = allOf(Stable, JavaStatic, JavaDefined, Enum)
678+
final val JavaEnumValue: FlagConjunction = allOf(StableRealizable, JavaStatic, JavaDefined, Enum)
679679

680680
/** Labeled private[this] */
681681
final val PrivateLocal: FlagConjunction = allOf(Private, Local)
@@ -684,7 +684,7 @@ object Flags {
684684
final val PrivateLocalParamAccessor: FlagConjunction = allOf(Private, Local, ParamAccessor)
685685

686686
/** A parameter forwarder */
687-
final val ParamForwarder: FlagConjunction = allOf(Method, Stable, ParamAccessor)
687+
final val ParamForwarder: FlagConjunction = allOf(Method, StableRealizable, ParamAccessor)
688688

689689
/** A private[this] parameter */
690690
final val PrivateLocalParam: FlagConjunction = allOf(Private, Local, Param)

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,7 @@ object SymDenotations {
611611
/** Is this a denotation of a stable term (or an arbitrary type)? */
612612
final def isStable(implicit ctx: Context): Boolean = {
613613
def isUnstableValue = is(UnstableValue) || info.isInstanceOf[ExprType]
614-
isType || is(Stable) || !isUnstableValue
614+
isType || is(StableRealizable) || !isUnstableValue
615615
}
616616

617617
/** Is this a denotation of a class that does not have - either direct or inherited -

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,7 @@ object Types {
542542
case tp: TermRef =>
543543
go (tp.underlying match {
544544
case mt: MethodType
545-
if mt.paramInfos.isEmpty && (tp.symbol is Stable) => mt.resultType
545+
if mt.paramInfos.isEmpty && (tp.symbol is StableRealizable) => mt.resultType
546546
case tp1 => tp1
547547
})
548548
case tp: TypeRef =>

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -651,7 +651,7 @@ class TreePickler(pickler: TastyPickler) {
651651
if (flags is Accessor) writeByte(FIELDaccessor)
652652
if (flags is CaseAccessor) writeByte(CASEaccessor)
653653
if (flags is DefaultParameterized) writeByte(DEFAULTparameterized)
654-
if (flags is Stable) writeByte(STABLE)
654+
if (flags is StableRealizable) writeByte(STABLE)
655655
if (flags is Extension) writeByte(EXTENSION)
656656
if (flags is ParamAccessor) writeByte(PARAMsetter)
657657
assert(!(flags is Label))

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -628,7 +628,7 @@ class TreeUnpickler(reader: TastyReader,
628628
case CONTRAVARIANT => addFlag(Contravariant)
629629
case SCALA2X => addFlag(Scala2x)
630630
case DEFAULTparameterized => addFlag(DefaultParameterized)
631-
case STABLE => addFlag(Stable)
631+
case STABLE => addFlag(StableRealizable)
632632
case EXTENSION => addFlag(Extension)
633633
case PARAMsetter =>
634634
addFlag(ParamAccessor)

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ object PickleBuffer {
218218
LOCAL -> Local,
219219
JAVA -> JavaDefined,
220220
SYNTHETIC -> Synthetic,
221-
STABLE -> Stable,
221+
STABLE -> StableRealizable,
222222
STATIC -> JavaStatic,
223223
CASEACCESSOR -> CaseAccessor,
224224
DEFAULTPARAM -> (DefaultParameterized, Trait),

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -858,7 +858,7 @@ object JavaParsers {
858858
skipAhead()
859859
accept(RBRACE)
860860
}
861-
ValDef(name.toTermName, enumType, unimplementedExpr).withMods(Modifiers(Flags.JavaEnum | Flags.Stable | Flags.JavaDefined | Flags.JavaStatic))
861+
ValDef(name.toTermName, enumType, unimplementedExpr).withMods(Modifiers(Flags.JavaEnum | Flags.StableRealizable | Flags.JavaDefined | Flags.JavaStatic))
862862
}
863863
}
864864

compiler/src/dotty/tools/dotc/tastyreflect/FlagsOpsImpl.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ trait FlagsOpsImpl extends scala.tasty.reflect.FlagsOps with CoreImpl {
3939
def Contravariant: Flags = core.Flags.Contravariant
4040
def Scala2X: Flags = core.Flags.Scala2x
4141
def DefaultParameterized: Flags = core.Flags.DefaultParameterized
42-
def Stable: Flags = core.Flags.Stable
42+
def Stable: Flags = core.Flags.StableRealizable
4343
def Param: Flags = core.Flags.Param
4444
def ParamAccessor: Flags = core.Flags.ParamAccessor
4545
}

compiler/src/dotty/tools/dotc/transform/ExplicitOuter.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ object ExplicitOuter {
176176
val deferredIfTrait = if (owner.is(Trait)) Deferred else EmptyFlags
177177
val outerAccIfOwn = if (owner == cls) OuterAccessor else EmptyFlags
178178
newOuterSym(owner, cls, outerAccName(cls),
179-
Final | Method | Stable | outerAccIfOwn | deferredIfTrait)
179+
Final | Method | StableRealizable | outerAccIfOwn | deferredIfTrait)
180180
}
181181

182182
private def outerAccName(cls: ClassSymbol)(implicit ctx: Context): TermName =

compiler/src/dotty/tools/dotc/transform/Getters.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class Getters extends MiniPhase with SymTransformer {
6161

6262
var d1 =
6363
if (d.isTerm && (d.is(Lazy) || d.owner.isClass) && d.info.isValueType && !noGetterNeeded) {
64-
val maybeStable = if (d.isStable) Stable else EmptyFlags
64+
val maybeStable = if (d.isStable) StableRealizable else EmptyFlags
6565
d.copySymDenotation(
6666
initFlags = d.flags | maybeStable | AccessorCreationFlags,
6767
info = ExprType(d.info))

compiler/src/dotty/tools/dotc/transform/Memoize.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ class Memoize extends MiniPhase with IdentityDenotTransformer { thisPhase =>
8080
ctx.newSymbol(
8181
owner = ctx.owner,
8282
name = sym.name.asTermName.fieldName,
83-
flags = Private | (if (sym is Stable) EmptyFlags else Mutable),
83+
flags = Private | (if (sym is StableRealizable) EmptyFlags else Mutable),
8484
info = fieldType,
8585
coord = tree.pos
8686
).withAnnotationsCarrying(sym, defn.FieldMetaAnnot)

compiler/src/dotty/tools/dotc/transform/ParamForwarding.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class ParamForwarding(thisPhase: DenotTransformer) {
6565
val alias = inheritedAccessor(sym)
6666
if (alias.exists) {
6767
def forwarder(implicit ctx: Context) = {
68-
sym.copySymDenotation(initFlags = sym.flags | Method | Stable, info = sym.info.ensureMethodic)
68+
sym.copySymDenotation(initFlags = sym.flags | Method | StableRealizable, info = sym.info.ensureMethodic)
6969
.installAfter(thisPhase)
7070
val superAcc =
7171
Super(This(currentClass), tpnme.EMPTY, inConstrCall = false).select(alias)

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -973,7 +973,7 @@ class Namer { typer: Typer =>
973973
cls.info = avoidPrivateLeaks(cls, cls.pos)
974974
cls.baseClasses.foreach(_.invalidateBaseTypeCache()) // we might have looked before and found nothing
975975
cls.setNoInitsFlags(parentsKind(parents), bodyKind(rest))
976-
if (cls.isNoInitsClass) cls.primaryConstructor.setFlag(Stable)
976+
if (cls.isNoInitsClass) cls.primaryConstructor.setFlag(StableRealizable)
977977
}
978978
}
979979

0 commit comments

Comments
 (0)