summary refs log tree commit diff stats
path: root/tests/template/tsymchoicefield.nim
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2014-03-24 18:42:31 +0100
committerAraq <rumpf_a@web.de>2014-03-24 18:42:31 +0100
commitbf2f6397c807991f09dd8325c1f860869a1a73b6 (patch)
treec1c6bb517689c6305583367843d74f0647aec7cf /tests/template/tsymchoicefield.nim
parent907e1b80b2a3a64cbd60f98c221cd662988d74aa (diff)
parente8c50640d7a4d386197b8508c82b26f5563060cb (diff)
downloadNim-bf2f6397c807991f09dd8325c1f860869a1a73b6.tar.gz
Merge branch 'devel' of https://github.com/Araq/Nimrod into devel
Diffstat (limited to 'tests/template/tsymchoicefield.nim')
-rw-r--r--tests/template/tsymchoicefield.nim12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/template/tsymchoicefield.nim b/tests/template/tsymchoicefield.nim
new file mode 100644
index 000000000..ab05500bf
--- /dev/null
+++ b/tests/template/tsymchoicefield.nim
@@ -0,0 +1,12 @@
+type Foo = object
+  len: int
+
+var f = Foo(len: 40)
+
+template getLen(f: Foo): expr = f.len
+
+echo f.getLen
+# This fails, because `len` gets the nkOpenSymChoice
+# treatment inside the template early pass and then
+# it can't be recognized as a field anymore
+