summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorhlaaftana <10591326+hlaaftana@users.noreply.github.com>2021-12-05 08:44:22 +0300
committerGitHub <noreply@github.com>2021-12-05 06:44:22 +0100
commit1ef945668d458163cb7116a8c936ff92b63d679d (patch)
tree1a2a614f5359922ed1bf94f02ade77002e4ce637 /tests
parentc658de24b04be9f898359a4091c5815f28de8785 (diff)
downloadNim-1ef945668d458163cb7116a8c936ff92b63d679d.tar.gz
treat do with pragmas but no parens as proc (#19191)
fixes #19188
Diffstat (limited to 'tests')
-rw-r--r--tests/parser/tdo.nim19
1 files changed, 17 insertions, 2 deletions
diff --git a/tests/parser/tdo.nim b/tests/parser/tdo.nim
index 7bd1f7411..382d03398 100644
--- a/tests/parser/tdo.nim
+++ b/tests/parser/tdo.nim
@@ -1,8 +1,12 @@
 discard """
-  output: '''true
+  output: '''
 true
 true
-true inner B'''
+true
+true inner B
+running with pragma
+ran with pragma
+'''
 """
 
 template withValue(a, b, c, d, e: untyped) =
@@ -77,3 +81,14 @@ proc main2 =
       echo "true inner B"
 
 main2()
+
+proc withPragma(foo: int, bar: proc() {.raises: [].}) =
+  echo "running with pragma"
+  bar()
+
+withPragma(3) do {.raises: [].}:
+  echo "ran with pragma"
+
+doAssert not (compiles do:
+  withPragma(3) do {.raises: [].}:
+    raise newException(Exception))