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 6726bb7 commit 7919c42Copy full SHA for 7919c42
compiler/src/dotty/tools/dotc/transform/init/Objects.scala
@@ -226,7 +226,8 @@ object Objects:
226
227
def read(ref: Ref, field: Symbol)(using state: State.Data): Value =
228
val data: Data = State.getHeap()
229
- data.map(Addr(ref, field))
+ // Primitive values are not in the heap and initialization errors are reported by the initialization checker.
230
+ data.map.getOrElse(Addr(ref, field), Bottom)
231
232
def write(ref: Ref, field: Symbol, value: Value)(using state: State.Data): Unit =
233
val addr = Addr(ref, field)
0 commit comments