summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2014-06-30 22:24:08 +0200
committerAraq <rumpf_a@web.de>2014-06-30 22:24:08 +0200
commit0339b9d386bd0efa3c31bd05c25cd9ed0f1c7dd5 (patch)
treec6e28c8401a78e5d9fd04fec89a65e2cfbe51681 /tests
parentb89495ef0f6bb60a3296fbaa7c4397dcd269f73d (diff)
downloadNim-0339b9d386bd0efa3c31bd05c25cd9ed0f1c7dd5.tar.gz
fixes #1319
Diffstat (limited to 'tests')
-rw-r--r--tests/macros/tbindsym.nim25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/macros/tbindsym.nim b/tests/macros/tbindsym.nim
new file mode 100644
index 000000000..e1e3b5112
--- /dev/null
+++ b/tests/macros/tbindsym.nim
@@ -0,0 +1,25 @@
+discard """
+  output: '''TFoo
+TBar'''
+"""
+
+# bug #1319
+
+import macros
+
+type
+  TTextKind = enum
+    TFoo, TBar
+
+macro test: stmt =
+  var x = @[TFoo, TBar]
+  result = newStmtList()
+  for i in x:
+    result.add newCall(newIdentNode("echo"),
+      case i
+      of TFoo:
+        bindSym("TFoo")
+      of TBar:
+        bindSym("TBar"))
+
+test()