aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/dotty/tools/dotc/core/SymDenotations.scala8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/core/SymDenotations.scala b/src/dotty/tools/dotc/core/SymDenotations.scala
index b76752cc0..fb59cae59 100644
--- a/src/dotty/tools/dotc/core/SymDenotations.scala
+++ b/src/dotty/tools/dotc/core/SymDenotations.scala
@@ -526,11 +526,17 @@ object SymDenotations {
final def isRealizable(implicit ctx: Context) =
is(Stable) || isType || {
val isRealizable =
- !is(Lazy, butNot = Module) ||
+ !isLateInitialized ||
isEffectivelyFinal && ctx.realizability(info) == TypeOps.Realizable
isRealizable && { setFlag(Stable); true }
}
+ /** Field is initialized on use, not on definition;
+ * we do not count modules as fields here.
+ */
+ final def isLateInitialized(implicit ctx: Context) =
+ is(Lazy, butNot = Module) || is(Param) && info.isInstanceOf[ExprType]
+
/** Is this a "real" method? A real method is a method which is:
* - not an accessor
* - not a label