diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2017-11-02 10:42:11 +0100 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2017-11-02 10:42:19 +0100 |
commit | bd19b5f4d36bb40b4af93d7e15fdfa582e9fe3b7 (patch) | |
tree | ee89b5c1d6c79ba4d0e6d974abd1792da644198f /tests/fields | |
parent | 31619c2a83700c979e432c2fb06ae96b3ffbe64c (diff) | |
download | Nim-bd19b5f4d36bb40b4af93d7e15fdfa582e9fe3b7.tar.gz |
implemented undocumented '.liftLocals' feature
Diffstat (limited to 'tests/fields')
-rw-r--r-- | tests/fields/timplicitfieldswithpartial.nim | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/tests/fields/timplicitfieldswithpartial.nim b/tests/fields/timplicitfieldswithpartial.nim index 996912a1a..a315cc5d0 100644 --- a/tests/fields/timplicitfieldswithpartial.nim +++ b/tests/fields/timplicitfieldswithpartial.nim @@ -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()) |