summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authormetagn <metagngn@gmail.com>2022-09-11 09:33:24 +0300
committerGitHub <noreply@github.com>2022-09-11 08:33:24 +0200
commit58e6d439d88fcac4950b1de80af96234688f056b (patch)
tree72082621eb08b85571572c576e6e1e2844479832 /tests
parent884f1f6b11e3dc8d57ffa6f393d8cdd9d70dded0 (diff)
downloadNim-58e6d439d88fcac4950b1de80af96234688f056b.tar.gz
fix #13515 [backport] (#20315)
* fix #13515

* only compile test

* no idea why this PR is unlocking this

* don't rope in symchoices

* even more restrictive
Diffstat (limited to 'tests')
-rw-r--r--tests/template/t13515.nim16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/template/t13515.nim b/tests/template/t13515.nim
new file mode 100644
index 000000000..ffebedcbe
--- /dev/null
+++ b/tests/template/t13515.nim
@@ -0,0 +1,16 @@
+discard """
+  action: compile
+"""
+
+template test: bool = true
+
+# compiles:
+if not test:
+  echo "wtf"
+
+# does not compile:
+template x =
+  if not test:
+    echo "wtf"
+
+x