mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-21 23:05:27 +00:00
implemented undocumented '.liftLocals' feature
This commit is contained in:
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user