We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8020677 commit ea8d6d9Copy full SHA for ea8d6d9
compiler/src/dotty/tools/dotc/transform/init/Objects.scala
@@ -766,8 +766,11 @@ object Objects:
766
val target = if needResolve then resolve(ref.klass, field) else field
767
if target.is(Flags.Lazy) then
768
given Env.Data = Env.emptyEnv(target.owner.asInstanceOf[ClassSymbol].primaryConstructor)
769
- val rhs = target.defTree.asInstanceOf[ValDef].rhs
770
- eval(rhs, ref, target.owner.asClass, cacheResult = true)
+ if target.hasSource then
+ val rhs = target.defTree.asInstanceOf[ValDef].rhs
771
+ eval(rhs, ref, target.owner.asClass, cacheResult = true)
772
+ else
773
+ Bottom
774
else if target.exists then
775
if target.isOneOf(Flags.Mutable) then
776
if ref.hasVar(target) then
0 commit comments