summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorflywind <43030857+xflywind@users.noreply.github.com>2020-11-02 17:58:14 +0800
committerGitHub <noreply@github.com>2020-11-02 10:58:14 +0100
commit5b4c17b5e7166220c7b5c149946579f245f54645 (patch)
tree2b4e00ce46075dbf5d33d14c2d80d67da3749494 /compiler
parent544cb107c75523196ceee9408f9b1d5d89c82e48 (diff)
downloadNim-5b4c17b5e7166220c7b5c149946579f245f54645.tar.gz
Closure iterators are not supported by VM (#15818)
Diffstat (limited to 'compiler')
-rw-r--r--compiler/vmgen.nim2
1 files changed, 2 insertions, 0 deletions
diff --git a/compiler/vmgen.nim b/compiler/vmgen.nim
index 0c0c491e0..61c7fefd9 100644
--- a/compiler/vmgen.nim
+++ b/compiler/vmgen.nim
@@ -1982,6 +1982,8 @@ proc gen(c: PCtx; n: PNode; dest: var TDest; flags: TGenFlags = {}) =
       genRdVar(c, n, dest, flags)
     of skProc, skFunc, skConverter, skMacro, skTemplate, skMethod, skIterator:
       # 'skTemplate' is only allowed for 'getAst' support:
+      if s.kind == skIterator and s.typ.callConv == TCallingConvention.ccClosure:
+        globalError(c.config, n.info, "Closure iterators are not supported by VM!")
       if procIsCallback(c, s): discard
       elif importcCond(s): c.importcSym(n.info, s)
       genLit(c, n, dest)