summary refs log tree commit diff stats
path: root/tests/fields
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2017-06-04 11:17:41 +0200
committerAndreas Rumpf <rumpf_a@web.de>2017-06-04 11:17:41 +0200
commitc59bc0cc183ccaed25e8e4a3cc286f2bb351405b (patch)
treeddafde8d4c3c0901ac1f3c02e3df298753cd3f8e /tests/fields
parent42c9bb3acedd524be23263a8217f34d0100779d9 (diff)
downloadNim-c59bc0cc183ccaed25e8e4a3cc286f2bb351405b.tar.gz
first steps to allow easy functors via macros
Diffstat (limited to 'tests/fields')
-rw-r--r--tests/fields/timplicitfieldswithpartial.nim19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/fields/timplicitfieldswithpartial.nim b/tests/fields/timplicitfieldswithpartial.nim
new file mode 100644
index 000000000..ab50f4276
--- /dev/null
+++ b/tests/fields/timplicitfieldswithpartial.nim
@@ -0,0 +1,19 @@
+discard """
+  out: '''(foo0: 38, other1: string here)
+43'''
+"""
+
+type
+  Base = ref object of RootObj
+  Foo {.partial.} = ref object of Base
+
+proc my(f: Foo) =
+  #var f.next = f
+  let f.foo = 38
+  let f.other = "string here"
+  echo f[]
+  echo f.foo0 + 5
+
+var g: Foo
+new(g)
+my(g)