mirror of
https://github.com/nim-lang/Nim.git
synced 2026-07-28 11:26:39 +00:00
* fix #16967 [backport:1.2] * move test to tsugar
This commit is contained in:
@@ -79,6 +79,22 @@ template main() =
|
||||
closure2 = () => (i, j)
|
||||
doAssert closure2() == (5, 3)
|
||||
|
||||
block: # bug #16967
|
||||
var s = newSeq[proc (): int](5)
|
||||
{.push exportc.}
|
||||
proc bar() =
|
||||
for i in 0 ..< s.len:
|
||||
let foo = i + 1
|
||||
capture foo:
|
||||
s[i] = proc(): int = foo
|
||||
{.pop.}
|
||||
|
||||
bar()
|
||||
|
||||
for i, p in s.pairs:
|
||||
let foo = i + 1
|
||||
doAssert p() == foo
|
||||
|
||||
block: # dup
|
||||
block dup_with_field:
|
||||
type
|
||||
|
||||
Reference in New Issue
Block a user