VM: improvements for var T/addr (#12667); fixes #12489

This commit is contained in:
Andreas Rumpf 2019-11-28 09:56:02 +01:00 • committed by GitHub
commit abe07eb75d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 156 additions and 11 deletions

View file

@ -7,7 +7,7 @@ discard """
# bug #3731
var list {.compileTime.} = newSeq[int]()
macro calc*(): typed =
macro calc*(): void =
list.add(1)
for c in list.mitems:
c = 13
@ -19,7 +19,7 @@ calc()
# bug #3859
import macros
macro m: typed =
macro m: void =
var s = newseq[NimNode](3)
# var s: array[3,NimNode] # not working either
for i in 0..<s.len: s[i] = newLit(3) # works