After the last update to 1.4.2 (from 1.4.0) I get the following error message:
Error: Closure iterators are not supported by JS backend!
The culprit line is ...
iterator foo*(limit: int = int.high): int {.closure.} =
<more code>
Is this a regression or are there any new features I'm not aware of?
I could not find any clues in
https://github.com/nim-lang/Nim/compare/v1.4.0...v1.4.2
Any suggestion what to do?
Thanks, this is the showstopper I run into.
The more appropriate error message might be:
"Error: Closure iterators are not supported anymore by JS backend!"
It seems to be "work in progress" and I'll wait for you guys to get this sorted out.
closure iterators never worked in JS backend.
iterator foo(limit: int = int.high): int {.closure.} =
yield 12
for x in foo(12):
discard
Error: internal error: for statement not eliminated No stack traceback available To create a stacktrace, rerun compilation with './koch temp js <file>', see https://nim-lang.github.io/Nim/intern.html#debugging-the-compiler for details
I checked my code and yes, you are right, the closure iterators never got used in my JS backend.
But the compilation worked in 1.4.0 without generating an error message for the unused iterators.
I put a bunch of when not defined(js) around the unused code and finally got 1.4.2 working.
Thxs