File tree 1 file changed +7
-3
lines changed
src/dotty/tools/dotc/core
1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -58,12 +58,16 @@ class CheckRealizable(implicit ctx: Context) {
58
58
*/
59
59
private val checkedFields : mutable.Set [Symbol ] = mutable.LinkedHashSet [Symbol ]()
60
60
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
+
61
66
/** 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).
63
67
*/
64
68
private def isLateInitialized (tp : Type ): Boolean = tp.dealias match {
65
69
case tp : TermRef =>
66
- tp.symbol.is( Lazy , butNot = Module ) || isLateInitialized(tp.prefix)
70
+ isLateInitialized( tp.symbol) || isLateInitialized(tp.prefix)
67
71
case _ : SingletonType | NoPrefix =>
68
72
false
69
73
case tp : TypeRef =>
@@ -84,7 +88,7 @@ class CheckRealizable(implicit ctx: Context) {
84
88
else {
85
89
val r =
86
90
if (! sym.isStable) NotStable
87
- else if (! sym. isLateInitialized) realizability(tp.prefix)
91
+ else if (! isLateInitialized(sym) ) realizability(tp.prefix)
88
92
else if (! sym.isEffectivelyFinal) new NotFinal (sym)
89
93
else realizability(tp.info).mapError(r => new ProblemInUnderlying (tp.info, r))
90
94
if (r == Realizable ) sym.setFlag(Stable )
You can’t perform that action at this time.
0 commit comments