Skip to content

Commit 1511cb4

Browse files
committed
Fix commpilation error
1 parent f6a5802 commit 1511cb4

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

Diff for: src/dotty/tools/dotc/core/CheckRealizable.scala

+7-3
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,16 @@ class CheckRealizable(implicit ctx: Context) {
5858
*/
5959
private val checkedFields: mutable.Set[Symbol] = mutable.LinkedHashSet[Symbol]()
6060

61+
/** Is symbol's definitition a lazy val?
62+
* (note we exclude modules here, because their realizability is ensured separately)
63+
*/
64+
private def isLateInitialized(sym: Symbol) = sym.is(Lazy, butNot = Module)
65+
6166
/** Is this type a path with some part that is initialized on use?
62-
* (note we exclude modules here, because their realizability is ensured separately).
6367
*/
6468
private def isLateInitialized(tp: Type): Boolean = tp.dealias match {
6569
case tp: TermRef =>
66-
tp.symbol.is(Lazy, butNot = Module) || isLateInitialized(tp.prefix)
70+
isLateInitialized(tp.symbol) || isLateInitialized(tp.prefix)
6771
case _: SingletonType | NoPrefix =>
6872
false
6973
case tp: TypeRef =>
@@ -84,7 +88,7 @@ class CheckRealizable(implicit ctx: Context) {
8488
else {
8589
val r =
8690
if (!sym.isStable) NotStable
87-
else if (!sym.isLateInitialized) realizability(tp.prefix)
91+
else if (!isLateInitialized(sym)) realizability(tp.prefix)
8892
else if (!sym.isEffectivelyFinal) new NotFinal(sym)
8993
else realizability(tp.info).mapError(r => new ProblemInUnderlying(tp.info, r))
9094
if (r == Realizable) sym.setFlag(Stable)

0 commit comments

Comments
 (0)