Closure iterators are not supported by VM (#15818)

This commit is contained in:
flywind 2020-11-02 17:58:14 +08:00 • committed by GitHub
commit 5b4c17b5e7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 0 deletions

View file

@ -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)