preparations for making 'closure' the default calling convention for proc types
This commit is contained in:
parent
56b4e3ad91
commit
8d99753d63
36 changed files with 117 additions and 102 deletions
|
|
@ -6,13 +6,13 @@ discard """
|
|||
proc main =
|
||||
const n = 30
|
||||
for iterations in 0..50_000:
|
||||
var s: seq[proc(): int {.closure.}] = @[]
|
||||
var s: seq[proc(): string {.closure.}] = @[]
|
||||
for i in 0 .. n-1:
|
||||
let ii = i
|
||||
s.add(proc(): int = return ii*ii)
|
||||
s.add(proc(): string = return $(ii*ii))
|
||||
for i in 0 .. n-1:
|
||||
let val = s[i]()
|
||||
if val != i*i: echo "bug ", val
|
||||
if val != $(i*i): echo "bug ", val
|
||||
|
||||
if getOccupiedMem() > 3000_000: quit("still a leak!")
|
||||
echo "success"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue