parent
c98e0e22ad
commit
78e02d174d
2 changed files with 22 additions and 1 deletions
|
|
@ -471,7 +471,8 @@ template handleJmpBack() {.dirty.} =
|
||||||
dec(c.loopIterations)
|
dec(c.loopIterations)
|
||||||
|
|
||||||
proc recSetFlagIsRef(arg: PNode) =
|
proc recSetFlagIsRef(arg: PNode) =
|
||||||
arg.flags.incl(nfIsRef)
|
if arg.kind notin {nkStrLit..nkTripleStrLit}:
|
||||||
|
arg.flags.incl(nfIsRef)
|
||||||
for i in 0 ..< arg.safeLen:
|
for i in 0 ..< arg.safeLen:
|
||||||
arg.sons[i].recSetFlagIsRef
|
arg.sons[i].recSetFlagIsRef
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,9 @@ main:end
|
||||||
(width: 0, height: 0, path: "")
|
(width: 0, height: 0, path: "")
|
||||||
@[(width: 0, height: 0, path: ""), (width: 0, height: 0, path: "")]
|
@[(width: 0, height: 0, path: ""), (width: 0, height: 0, path: "")]
|
||||||
Done!
|
Done!
|
||||||
|
foo4
|
||||||
|
foo4
|
||||||
|
foo4
|
||||||
'''
|
'''
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
@ -214,3 +217,20 @@ static:
|
||||||
someTransform(state)
|
someTransform(state)
|
||||||
|
|
||||||
doAssert state[1] == 13087528040916209671'u64
|
doAssert state[1] == 13087528040916209671'u64
|
||||||
|
|
||||||
|
import macros
|
||||||
|
# bug #12670
|
||||||
|
|
||||||
|
macro fooImpl(arg: untyped) =
|
||||||
|
result = quote do:
|
||||||
|
`arg`
|
||||||
|
|
||||||
|
proc foo(): string {.compileTime.} =
|
||||||
|
fooImpl:
|
||||||
|
result = "foo"
|
||||||
|
result.addInt 4
|
||||||
|
|
||||||
|
static:
|
||||||
|
echo foo()
|
||||||
|
echo foo()
|
||||||
|
echo foo()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue