diff options
author | Martin Odersky <odersky@gmail.com> | 2016-02-01 12:13:41 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2016-02-09 09:43:07 +0100 |
commit | 20fc6bd93c543f98da39a165437234670505f860 (patch) | |
tree | b880ce3f39d1689c6cdf23d2d142df877db2f4e3 /src/dotty/tools/dotc/core/SymDenotations.scala | |
parent | f44a1ed47d8fc68d9dae321fd28433b70abf7bfe (diff) | |
download | dotty-20fc6bd93c543f98da39a165437234670505f860.tar.gz dotty-20fc6bd93c543f98da39a165437234670505f860.tar.bz2 dotty-20fc6bd93c543f98da39a165437234670505f860.zip |
Consider by name parameters as lazily initialized
should be terated analogous to lazy vals for realizability checking.
Diffstat (limited to 'src/dotty/tools/dotc/core/SymDenotations.scala')
-rw-r--r-- | src/dotty/tools/dotc/core/SymDenotations.scala | 8 |
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 |