diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2017-10-29 07:54:39 +0100 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2017-10-29 07:54:39 +0100 |
commit | c17f6c7837d9fc2268543e34c03f95e50229650d (patch) | |
tree | b9d5684711c314ebf8b56b3f9b1b218ce39cdae5 /tests/package_level_objects/tusefoo2.nim | |
parent | 7889692523c5738c901609024ebabf91b44fa719 (diff) | |
download | Nim-c17f6c7837d9fc2268543e34c03f95e50229650d.tar.gz |
new feature: package level objects
Diffstat (limited to 'tests/package_level_objects/tusefoo2.nim')
-rw-r--r-- | tests/package_level_objects/tusefoo2.nim | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/package_level_objects/tusefoo2.nim b/tests/package_level_objects/tusefoo2.nim new file mode 100644 index 000000000..be6b3fcda --- /dev/null +++ b/tests/package_level_objects/tusefoo2.nim @@ -0,0 +1,19 @@ +discard """ + output: '''compiles''' +""" + +# Test that the object type does not need to be resolved at all: + +type + mypackage.Foo = object + Other = proc (inp: Foo) + + Node = ref object + external: ptr Foo + data: string + +var x: Node +new(x) +x.data = "compiles" + +echo x.data |