summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2019-05-08 17:50:41 +0200
committerGitHub <noreply@github.com>2019-05-08 17:50:41 +0200
commitcd79c6f5323f70a1f3783cd8f0f17f47ed523fed (patch)
treeca3dbdaa0e9cba9d15a0505b5b9b5fbff8db03c8 /compiler
parent65b6250e59b8db6a54e01ba3e443c9ee0add6e48 (diff)
parent1f207df7aef7dd469a998a4522891b25eab4c9df (diff)
downloadNim-cd79c6f5323f70a1f3783cd8f0f17f47ed523fed.tar.gz
Merge pull request #11159 from JasperJenkins/const-named-tuple-unpack
Const named tuple unpacking
Diffstat (limited to 'compiler')
-rw-r--r--compiler/semstmts.nim3
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/semstmts.nim b/compiler/semstmts.nim
index 1cf8e7ab2..6a92e9221 100644
--- a/compiler/semstmts.nim
+++ b/compiler/semstmts.nim
@@ -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