summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorringabout <43030857+ringabout@users.noreply.github.com>2023-11-14 14:15:44 +0800
committerGitHub <noreply@github.com>2023-11-14 07:15:44 +0100
commit0dc3513613f87beb6ab5a590360ced7c9d33b1e3 (patch)
treec013f0149196d324c2ec141b6cb135eb194cd430 /tests
parent52784f32bbb6c764eb67a1abdbbbd9f54dc6030e (diff)
downloadNim-0dc3513613f87beb6ab5a590360ced7c9d33b1e3.tar.gz
fixes #22932; treats closure iterators as pointers (#22934)
fixes #22932
follow up https://github.com/nim-lang/Nim/pull/21629

---------

Co-authored-by: Nickolay Bukreyev <SirNickolas@users.noreply.github.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/stdlib/toptions.nim8
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/stdlib/toptions.nim b/tests/stdlib/toptions.nim
index 4f1251abb..63a10e746 100644
--- a/tests/stdlib/toptions.nim
+++ b/tests/stdlib/toptions.nim
@@ -196,6 +196,12 @@ proc main() =
         doAssert x.isNone
         doAssert $x == "none(cstring)"
 
-
 static: main()
 main()
+
+when not defined(js):
+  block: # bug #22932
+    var it = iterator: int {.closure.} = discard
+    doAssert it.option.isSome # Passes.
+    it = nil
+    doAssert it.option.isNone # Passes.