summary refs log tree commit diff stats
path: root/tests/package_level_objects/tusefoo2.nim
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2017-10-29 07:54:39 +0100
committerAndreas Rumpf <rumpf_a@web.de>2017-10-29 07:54:39 +0100
commitc17f6c7837d9fc2268543e34c03f95e50229650d (patch)
treeb9d5684711c314ebf8b56b3f9b1b218ce39cdae5 /tests/package_level_objects/tusefoo2.nim
parent7889692523c5738c901609024ebabf91b44fa719 (diff)
downloadNim-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.nim19
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