Skip to content

Commit 37b8720

Browse files
committed
Cache stability of non-lazy stable symbols
That is, set is(Stable) for symbols that satisfy isStable.
1 parent 61d26b9 commit 37b8720

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,12 @@ class CheckRealizable(implicit ctx: Context) {
9191
if (!sym.isStable)
9292
patchRealizability(NotStable)
9393
// 3. If the symbol isn't "lazy" and its prefix is realizable
94-
else if (!isLateInitialized(sym))
95-
// XXX: This is a bit fishy: we only cache that the symbol is
96-
// stable if it appears under a realizable prefix.
97-
// XXX: Add object DependsOnPrefix extends Realizability(""), but filter it out here.
94+
else if (!isLateInitialized(sym)) {
95+
// The symbol itself is stable, cache this information:
96+
sym.setFlag(Stable)
97+
// Realizability now depends on the prefix:
9898
patchRealizability(realizability(tp.prefix))
99-
else if (!sym.isEffectivelyFinal)
99+
} else if (!sym.isEffectivelyFinal)
100100
patchRealizability(new NotFinal(sym))
101101
else
102102
// 4. If the symbol is effectively final, and a lazy or erased val

0 commit comments

Comments
 (0)