Merge pull request #11159 from JasperJenkins/const-named-tuple-unpack

Const named tuple unpacking
This commit is contained in:
Andreas Rumpf 2019-05-08 17:50:41 +02:00 • committed by GitHub
commit cd79c6f532
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 23 additions and 2 deletions

View file

@ -641,7 +641,8 @@ proc semConst(c: PContext, n: PNode): PNode =
addSon(b, copyTree(def))
else:
setVarType(c, v, typ.sons[j])
v.ast = def[j]
v.ast = if def[j].kind != nkExprColonExpr: def[j]
else: def[j].sons[1]
b.sons[j] = newSymNode(v)
addSon(result,b)
dec c.inStaticContext