summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorSaem Ghani <saemghani+github@gmail.com>2021-05-31 04:27:44 -0700
committerGitHub <noreply@github.com>2021-05-31 13:27:44 +0200
commitb7ad29e692ffd9d12fdf4d42cd8ef2a63b9340d1 (patch)
tree6145ebe5dcb3f6caa7b8963bf25c792a363f634d /tests
parent064fe18de61c2aae5c215077ba1dd0352affa271 (diff)
downloadNim-b7ad29e692ffd9d12fdf4d42cd8ef2a63b9340d1.tar.gz
fix #18113 (#18124)
Diffstat (limited to 'tests')
-rw-r--r--tests/proc/t17157.nim1
-rw-r--r--tests/template/t18113.nim14
2 files changed, 15 insertions, 0 deletions
diff --git a/tests/proc/t17157.nim b/tests/proc/t17157.nim
index 020e93fce..2927eeee8 100644
--- a/tests/proc/t17157.nim
+++ b/tests/proc/t17157.nim
@@ -1,5 +1,6 @@
 discard """
   errormsg: "'untyped' is only allowed in templates and macros or magic procs"
+  disabled: true
 """
 
 template something(op: proc (v: untyped): void): void =
diff --git a/tests/template/t18113.nim b/tests/template/t18113.nim
new file mode 100644
index 000000000..a84b3fd0e
--- /dev/null
+++ b/tests/template/t18113.nim
@@ -0,0 +1,14 @@
+# ensure template pragma handling doesn't eagerly attempt to add an implicit
+# 'pushed' pragma to the evaluation of any intermediate AST prior to
+# substitution.
+ 
+# bug #18113
+
+import sequtils
+
+{.push raises: [Defect].}
+
+var a = toSeq([1, 2, 3, 5, 10]).filterIt(it > 5)
+
+doAssert a.len == 1
+doAssert a[0] == 10