mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-06 04:57:49 +00:00
13 lines
219 B
Nim
13 lines
219 B
Nim
discard """
|
|
errormsg: "Closure iterators are not supported by JS backend!"
|
|
"""
|
|
|
|
iterator iter*(): int {.closure.} =
|
|
yield 3
|
|
|
|
var x = iter
|
|
doAssert x() == 3
|
|
|
|
let fIt = iterator(): int = yield 70
|
|
doAssert fIt() == 70
|