parent
111092e8aa
commit
eef2948ec2
2 changed files with 12 additions and 2 deletions
|
|
@ -555,6 +555,10 @@ proc semTemplBody(c: var TemplCtx, n: PNode): PNode =
|
||||||
result[1] = semTemplBody(c, n[1])
|
result[1] = semTemplBody(c, n[1])
|
||||||
else:
|
else:
|
||||||
result = semTemplBodySons(c, n)
|
result = semTemplBodySons(c, n)
|
||||||
|
of nkTableConstr:
|
||||||
|
# also transform the keys (bug #12595)
|
||||||
|
for i in 0..<n.len:
|
||||||
|
result[i] = semTemplBodySons(c, n[i])
|
||||||
else:
|
else:
|
||||||
result = semTemplBodySons(c, n)
|
result = semTemplBodySons(c, n)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -256,7 +256,7 @@ discard foo()
|
||||||
type
|
type
|
||||||
IteratorF*[In] = iterator() : In {.closure.}
|
IteratorF*[In] = iterator() : In {.closure.}
|
||||||
|
|
||||||
template foof(In: untyped) : untyped =
|
template foof(In: untyped) : untyped =
|
||||||
proc ggg*(arg: IteratorF[In]) =
|
proc ggg*(arg: IteratorF[In]) =
|
||||||
for i in arg():
|
for i in arg():
|
||||||
echo "foo"
|
echo "foo"
|
||||||
|
|
@ -265,7 +265,7 @@ template foof(In: untyped) : untyped =
|
||||||
iterator hello() : int {.closure.} =
|
iterator hello() : int {.closure.} =
|
||||||
for i in 1 .. 3:
|
for i in 1 .. 3:
|
||||||
yield i
|
yield i
|
||||||
|
|
||||||
foof(int)
|
foof(int)
|
||||||
ggg(hello)
|
ggg(hello)
|
||||||
|
|
||||||
|
|
@ -290,3 +290,9 @@ proc bar(t: var int) =
|
||||||
|
|
||||||
foo(bar)
|
foo(bar)
|
||||||
|
|
||||||
|
block: # bug #12595
|
||||||
|
template test() =
|
||||||
|
let i = 42
|
||||||
|
discard {i: ""}
|
||||||
|
|
||||||
|
test()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue