[nim check]fix #17460 (#17569)

This commit is contained in:
flywind 2021-03-30 00:28:55 +08:00 • committed by GitHub
commit 3f9c51a332
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 0 deletions

View file

@ -726,6 +726,8 @@ proc semForVars(c: PContext, n: PNode; flags: TExprFlags): PNode =
if n[0].kind == nkVarTuple:
if n[0].len-1 != iterAfterVarLent.len:
localError(c.config, n[0].info, errWrongNumberOfVariables)
return errorNode(c, n)
for i in 0..<n[0].len-1:
var v = symForVar(c, n[0][i])
if getCurrOwner(c).kind == skModule: incl(v.flags, sfGlobal)