Skip to content

Commit

Permalink
Rename: Stable -> StableRealizable
Browse files Browse the repository at this point in the history
  • Loading branch information
Blaisorblade committed Jan 22, 2019
1 parent 413cfda commit 4fc5e25
Show file tree
Hide file tree
Showing 14 changed files with 20 additions and 20 deletions.
4 changes: 2 additions & 2 deletions compiler/src/dotty/tools/dotc/core/CheckRealizable.scala
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class CheckRealizable(implicit ctx: Context) {
case tp: TermRef =>
val sym = tp.symbol
lazy val tpInfoRealizable = realizability(tp.info)
if (sym.is(Stable)) realizability(tp.prefix)
if (sym.is(StableRealizable)) realizability(tp.prefix)
else {
val r =
if (sym.isStable && !isLateInitialized(sym))
Expand All @@ -83,7 +83,7 @@ class CheckRealizable(implicit ctx: Context) {
// roughly: it's realizable if the info does not have bad bounds
tpInfoRealizable.mapError(r => new ProblemInUnderlying(tp, r))
r andAlso {
if (sym.isStable) sym.setFlag(Stable) // it's known to be stable and realizable
if (sym.isStable) sym.setFlag(StableRealizable) // it's known to be stable and realizable
realizability(tp.prefix)
} mapError { r =>
if (tp.info.isStable && tpInfoRealizable == Realizable) Realizable else r
Expand Down
12 changes: 6 additions & 6 deletions compiler/src/dotty/tools/dotc/core/Flags.scala
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ object Flags {
final val Abstract: FlagSet = commonFlag(23, "abstract")

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

/** A case parameter accessor */
final val CaseAccessor: FlagSet = termFlag(25, "<caseaccessor>")
Expand Down Expand Up @@ -509,7 +509,7 @@ object Flags {
final val RetainedTypeArgFlags: FlagSet = VarianceFlags | Protected | Local

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

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

/** Flags that can apply to a module class */
final val RetainedModuleClassFlags: FlagSet = RetainedModuleValAndClassFlags |
Expand Down Expand Up @@ -585,7 +585,7 @@ object Flags {
final val InlineOrProxy: FlagSet = Inline | InlineProxy

/** Assumed to be pure */
final val StableOrErased: FlagSet = Stable | Erased
final val StableOrErased: FlagSet = StableRealizable | Erased

/** Labeled `private`, `final`, or `inline` */
final val EffectivelyFinal: FlagSet = Private | Final | Inline
Expand Down Expand Up @@ -678,7 +678,7 @@ object Flags {
final val JavaEnumTrait: FlagConjunction = allOf(JavaDefined, Enum)

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

/** Labeled private[this] */
final val PrivateLocal: FlagConjunction = allOf(Private, Local)
Expand All @@ -687,7 +687,7 @@ object Flags {
final val PrivateLocalParamAccessor: FlagConjunction = allOf(Private, Local, ParamAccessor)

/** A parameter forwarder */
final val ParamForwarder: FlagConjunction = allOf(Method, Stable, ParamAccessor)
final val ParamForwarder: FlagConjunction = allOf(Method, StableRealizable, ParamAccessor)

/** A private[this] parameter */
final val PrivateLocalParam: FlagConjunction = allOf(Private, Local, Param)
Expand Down
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/core/SymDenotations.scala
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,7 @@ object SymDenotations {
/** Is this a denotation of a stable term (or an arbitrary type)? */
final def isStable(implicit ctx: Context): Boolean = {
def isUnstableValue = is(UnstableValue) || info.isInstanceOf[ExprType]
isType || is(Stable) || !isUnstableValue
isType || is(StableRealizable) || !isUnstableValue
}

/** Is this a denotation of a class that does not have - either direct or inherited -
Expand Down
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/core/Types.scala
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,7 @@ object Types {
case tp: TermRef =>
go (tp.underlying match {
case mt: MethodType
if mt.paramInfos.isEmpty && (tp.symbol is Stable) => mt.resultType
if mt.paramInfos.isEmpty && (tp.symbol is StableRealizable) => mt.resultType
case tp1 => tp1
})
case tp: TypeRef =>
Expand Down
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/core/tasty/TreePickler.scala
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,7 @@ class TreePickler(pickler: TastyPickler) {
if (flags is Accessor) writeByte(FIELDaccessor)
if (flags is CaseAccessor) writeByte(CASEaccessor)
if (flags is DefaultParameterized) writeByte(DEFAULTparameterized)
if (flags is Stable) writeByte(STABLE)
if (flags is StableRealizable) writeByte(STABLE)
if (flags is Extension) writeByte(EXTENSION)
if (flags is ParamAccessor) writeByte(PARAMsetter)
assert(!(flags is Label))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,7 @@ class TreeUnpickler(reader: TastyReader,
case CONTRAVARIANT => addFlag(Contravariant)
case SCALA2X => addFlag(Scala2x)
case DEFAULTparameterized => addFlag(DefaultParameterized)
case STABLE => addFlag(Stable)
case STABLE => addFlag(StableRealizable)
case EXTENSION => addFlag(Extension)
case PARAMsetter =>
addFlag(ParamAccessor)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ object PickleBuffer {
LOCAL -> Local,
JAVA -> JavaDefined,
SYNTHETIC -> Synthetic,
STABLE -> Stable,
STABLE -> StableRealizable,
STATIC -> JavaStatic,
CASEACCESSOR -> CaseAccessor,
DEFAULTPARAM -> (DefaultParameterized, Trait),
Expand Down
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/parsing/JavaParsers.scala
Original file line number Diff line number Diff line change
Expand Up @@ -858,7 +858,7 @@ object JavaParsers {
skipAhead()
accept(RBRACE)
}
ValDef(name.toTermName, enumType, unimplementedExpr).withMods(Modifiers(Flags.JavaEnum | Flags.Stable | Flags.JavaDefined | Flags.JavaStatic))
ValDef(name.toTermName, enumType, unimplementedExpr).withMods(Modifiers(Flags.JavaEnum | Flags.StableRealizable | Flags.JavaDefined | Flags.JavaStatic))
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ trait FlagsOpsImpl extends scala.tasty.reflect.FlagsOps with CoreImpl {
def Contravariant: Flags = core.Flags.Contravariant
def Scala2X: Flags = core.Flags.Scala2x
def DefaultParameterized: Flags = core.Flags.DefaultParameterized
def Stable: Flags = core.Flags.Stable
def Stable: Flags = core.Flags.StableRealizable
def Param: Flags = core.Flags.Param
def ParamAccessor: Flags = core.Flags.ParamAccessor
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ object ExplicitOuter {
val deferredIfTrait = if (owner.is(Trait)) Deferred else EmptyFlags
val outerAccIfOwn = if (owner == cls) OuterAccessor else EmptyFlags
newOuterSym(owner, cls, outerAccName(cls),
Final | Method | Stable | outerAccIfOwn | deferredIfTrait)
Final | Method | StableRealizable | outerAccIfOwn | deferredIfTrait)
}

private def outerAccName(cls: ClassSymbol)(implicit ctx: Context): TermName =
Expand Down
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/transform/Getters.scala
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class Getters extends MiniPhase with SymTransformer {

var d1 =
if (d.isTerm && (d.is(Lazy) || d.owner.isClass) && d.info.isValueType && !noGetterNeeded) {
val maybeStable = if (d.isStable) Stable else EmptyFlags
val maybeStable = if (d.isStable) StableRealizable else EmptyFlags
d.copySymDenotation(
initFlags = d.flags | maybeStable | AccessorCreationFlags,
info = ExprType(d.info))
Expand Down
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/transform/Memoize.scala
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class Memoize extends MiniPhase with IdentityDenotTransformer { thisPhase =>
ctx.newSymbol(
owner = ctx.owner,
name = sym.name.asTermName.fieldName,
flags = Private | (if (sym is Stable) EmptyFlags else Mutable),
flags = Private | (if (sym is StableRealizable) EmptyFlags else Mutable),
info = fieldType,
coord = tree.span
).withAnnotationsCarrying(sym, defn.FieldMetaAnnot)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class ParamForwarding(thisPhase: DenotTransformer) {
val alias = inheritedAccessor(sym)
if (alias.exists) {
def forwarder(implicit ctx: Context) = {
sym.copySymDenotation(initFlags = sym.flags | Method | Stable, info = sym.info.ensureMethodic)
sym.copySymDenotation(initFlags = sym.flags | Method | StableRealizable, info = sym.info.ensureMethodic)
.installAfter(thisPhase)
val superAcc =
Super(This(currentClass), tpnme.EMPTY, inConstrCall = false).select(alias)
Expand Down
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/typer/Namer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1056,7 +1056,7 @@ class Namer { typer: Typer =>
cls.info = avoidPrivateLeaks(cls, cls.sourcePos)
cls.baseClasses.foreach(_.invalidateBaseTypeCache()) // we might have looked before and found nothing
cls.setNoInitsFlags(parentsKind(parents), bodyKind(rest))
if (cls.isNoInitsClass) cls.primaryConstructor.setFlag(Stable)
if (cls.isNoInitsClass) cls.primaryConstructor.setFlag(StableRealizable)
}
}

Expand Down

0 comments on commit 4fc5e25

Please sign in to comment.