opcLdDeref
(eg via addr) gives wrong results in inside static block
#13887
Labels
const
`const x=expr` or `static: stmt`
opcLdDeref
gives wrong results in VM inside static blockExample 1
Current Output
doAssert s[0] == 100
failsExpected Output
works
Example 2
shows that pointer is conflated for value:
Example 3
Error: unhandled exception: 'intVal' is not accessible using discriminant 'kind' of type 'TNode' [FieldError]
Possible Solution
nkPtrLit
(right now it's an alias ofnkIntLit
) unless we can fix this cleanly withnfIsPtr+ tyPtr
checksstatic: stmt
andconst foo = expr
into immediately invoked lambas => fixes many bugs RFCs#276Additional Information
The text was updated successfully, but these errors were encountered: