Skip to content

Commit 63535f0

Browse files
oderskyBlaisorblade
authored andcommitted
Clean up logic for isStable
1 parent 01c5eac commit 63535f0

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -589,12 +589,14 @@ object SymDenotations {
589589
)
590590

591591
/** Is this a denotation of a stable term (or an arbitrary type)? */
592-
final def isStable(implicit ctx: Context) =
593-
isType || is(StableOrErased) || !is(UnstableValue) && !info.isInstanceOf[ExprType]
592+
final def isStable(implicit ctx: Context) = {
593+
def isUnstableValue = is(UnstableValue) || info.isInstanceOf[ExprType]
594+
isType || is(StableOrErased) || !isUnstableValue
595+
}
594596

595597
/** Is this a denotation of a class that does not have - either direct or inherited -
596-
* initaliazion code?
597-
*/
598+
* initaliazion code?
599+
*/
598600
def isNoInitsClass(implicit ctx: Context) =
599601
isClass && asClass.baseClasses.forall(_.is(NoInits))
600602

0 commit comments

Comments
 (0)