implemented undocumented '.liftLocals' feature
This commit is contained in:
parent
31619c2a83
commit
bd19b5f4d3
5 changed files with 35 additions and 7 deletions
|
|
@ -1,6 +1,8 @@
|
|||
discard """
|
||||
output: '''(foo: 38, other: string here)
|
||||
43'''
|
||||
43
|
||||
100
|
||||
90'''
|
||||
"""
|
||||
|
||||
type
|
||||
|
|
@ -17,3 +19,17 @@ proc my(f: Foo) =
|
|||
var g: Foo
|
||||
new(g)
|
||||
my(g)
|
||||
|
||||
type
|
||||
FooTask {.partial.} = ref object of RootObj
|
||||
|
||||
proc foo(t: FooTask) {.liftLocals: t.} =
|
||||
var x = 90
|
||||
if true:
|
||||
var x = 10
|
||||
while x < 100:
|
||||
inc x
|
||||
echo x
|
||||
echo x
|
||||
|
||||
foo(FooTask())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue