summary refs log tree commit diff stats
path: root/tests/misc/t3482.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/misc/t3482.nim')
-rw-r--r--tests/misc/t3482.nim15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/misc/t3482.nim b/tests/misc/t3482.nim
new file mode 100644
index 000000000..33b3b8f40
--- /dev/null
+++ b/tests/misc/t3482.nim
@@ -0,0 +1,15 @@
+discard """
+  action: reject
+  nimout: "t3482.nim(13, 8) Error: undeclared identifier: 'output'"
+"""
+# bug #3482 (correct behavior since 1.4.0, cgen error in 1.2.0)
+template foo*(body: typed) =
+  if true:
+    body
+
+proc test =
+  foo:
+    var output = ""
+  echo output.len
+
+test()