summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorkonsumlamm <44230978+konsumlamm@users.noreply.github.com>2023-07-22 21:11:08 +0200
committerGitHub <noreply@github.com>2023-07-22 21:11:08 +0200
commit0e555ade3128c80ec73ce3195a0c42096055daeb (patch)
tree5fd6142d2b7e8b5b25459c7ffe4a53b35a85b7b8
parent576f4a73483a5d3b4c600f6d3d3c85394ffb43ee (diff)
downloadNim-0e555ade3128c80ec73ce3195a0c42096055daeb.tar.gz
Add test for #22309 (#22316)
-rw-r--r--tests/defer/t22309.nim11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/defer/t22309.nim b/tests/defer/t22309.nim
new file mode 100644
index 000000000..34ca4843b
--- /dev/null
+++ b/tests/defer/t22309.nim
@@ -0,0 +1,11 @@
+block:
+  defer:
+    let a = 42
+  doAssert not declared(a)
+
+proc lol() =
+  defer:
+    let a = 42
+  doAssert not declared(a)
+
+lol()