File tree Expand file tree Collapse file tree 7 files changed +9
-9
lines changed
compiler/src/dotty/tools/dotc Expand file tree Collapse file tree 7 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -399,7 +399,7 @@ trait TypedTreeInfo extends TreeInfo[Type] { self: Trees.Instance[Type] =>
399
399
*/
400
400
private def refPurity (tree : Tree )(implicit ctx : Context ): PurityLevel =
401
401
if (! tree.tpe.widen.isParameterless || tree.symbol.is(Erased )) SimplyPure
402
- else if (! tree.symbol.isStable ) Impure
402
+ else if (! tree.symbol.isStableMember ) Impure
403
403
else if (tree.symbol.is(Lazy )) Idempotent // TODO add Module flag, sinxce Module vals or not Lazy from the start.
404
404
else SimplyPure
405
405
@@ -462,7 +462,7 @@ trait TypedTreeInfo extends TreeInfo[Type] { self: Trees.Instance[Type] =>
462
462
case tpe : PolyType => maybeGetterType(tpe.resultType)
463
463
case _ => false
464
464
}
465
- sym.owner.isClass && ! sym.isStable && maybeGetterType(sym.info)
465
+ sym.owner.isClass && ! sym.isStableMember && maybeGetterType(sym.info)
466
466
}
467
467
468
468
/** Is tree a reference to a mutable variable, or to a potential getter
Original file line number Diff line number Diff line change @@ -86,7 +86,7 @@ class CheckRealizable(implicit ctx: Context) {
86
86
r.mapError(if (tp.info.isStableRealizable) Realizable else _)
87
87
val r =
88
88
// Reject fields that are mutable, by-name, and similar.
89
- if (! sym.isStable )
89
+ if (! sym.isStableMember )
90
90
patchRealizability(NotStable )
91
91
// 3. If the symbol isn't "lazy" and its prefix is realizable
92
92
else if (! isLateInitialized(sym)) {
Original file line number Diff line number Diff line change @@ -599,7 +599,7 @@ object SymDenotations {
599
599
)
600
600
601
601
/** Is this a denotation of a stable term (or an arbitrary type)? */
602
- final def isStable (implicit ctx : Context ) = {
602
+ final def isStableMember (implicit ctx : Context ) = {
603
603
def isUnstableValue = is(UnstableValue ) || info.isInstanceOf [ExprType ]
604
604
isType || is(Stable ) || ! isUnstableValue
605
605
}
Original file line number Diff line number Diff line change @@ -148,7 +148,7 @@ object Types {
148
148
149
149
/** Does this type denote a stable reference (i.e. singleton type)? */
150
150
final def isStable (implicit ctx : Context ): Boolean = stripTypeVar match {
151
- case tp : TermRef => tp.termSymbol.isStable && tp.prefix.isStable || tp.info.isStable
151
+ case tp : TermRef => tp.termSymbol.isStableMember && tp.prefix.isStable || tp.info.isStable
152
152
case _ : SingletonType | NoPrefix => true
153
153
case tp : RefinedOrRecType => tp.parent.isStable
154
154
case tp : ExprType => tp.resultType.isStable
@@ -960,7 +960,7 @@ object Types {
960
960
/** Widen type if it is unstable (i.e. an ExprType, or TermRef to unstable symbol */
961
961
final def widenIfUnstable (implicit ctx : Context ): Type = stripTypeVar match {
962
962
case tp : ExprType => tp.resultType.widenIfUnstable
963
- case tp : TermRef if ! tp.symbol.isStable => tp.underlying.widenIfUnstable
963
+ case tp : TermRef if ! tp.symbol.isStableMember => tp.underlying.widenIfUnstable
964
964
case _ => this
965
965
}
966
966
Original file line number Diff line number Diff line change @@ -278,7 +278,7 @@ private class ExtractAPICollector(implicit val ctx: Context) extends ThunkHolder
278
278
} else if (sym.is(Mutable , butNot = Accessor )) {
279
279
new api.Var (apiType(sym.info), sym.name.toString,
280
280
apiAccess(sym), apiModifiers(sym), apiAnnotations(sym).toArray)
281
- } else if (sym.isStable ) {
281
+ } else if (sym.isStableMember ) {
282
282
new api.Val (apiType(sym.info), sym.name.toString,
283
283
apiAccess(sym), apiModifiers(sym), apiAnnotations(sym).toArray)
284
284
} else {
Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ class Getters extends MiniPhase with SymTransformer {
59
59
d.hasAnnotation(defn.ScalaStaticAnnot ) ||
60
60
d.isSelfSym
61
61
if (d.isTerm && (d.is(Lazy ) || d.owner.isClass) && d.info.isValueType && ! noGetterNeeded) {
62
- val maybeStable = if (d.isStable ) Stable else EmptyFlags
62
+ val maybeStable = if (d.isStableMember ) Stable else EmptyFlags
63
63
d.copySymDenotation(
64
64
initFlags = d.flags | maybeStable | AccessorCreationFlags ,
65
65
info = ExprType (d.info))
Original file line number Diff line number Diff line change @@ -367,7 +367,7 @@ object RefChecks {
367
367
intersectionIsEmpty(member.extendedOverriddenSymbols, other.extendedOverriddenSymbols)) {
368
368
overrideError(" cannot override a concrete member without a third member that's overridden by both " +
369
369
" (this rule is designed to prevent ``accidental overrides'')" )
370
- } else if (other.isStable && ! member.isStable ) { // (1.4)
370
+ } else if (other.isStableMember && ! member.isStableMember ) { // (1.4)
371
371
overrideError(" needs to be a stable, immutable value" )
372
372
} else if (member.is(ModuleVal ) && ! other.isRealMethod && ! other.is(Deferred | Lazy )) {
373
373
overrideError(" may not override a concrete non-lazy value" )
You can’t perform that action at this time.
0 commit comments