diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2019-08-22 18:57:41 +0200 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2019-08-22 18:57:41 +0200 |
commit | 085fbcea6f054ec638250853c3e85a0e51c3f3bd (patch) | |
tree | eb52f806c24117a072beb0db02fbc159acc39126 | |
parent | 9eee15f6683ad50a881adbfa7bfd4ca9b2b717bc (diff) | |
download | Nim-085fbcea6f054ec638250853c3e85a0e51c3f3bd.tar.gz |
fixes #10854
-rw-r--r-- | compiler/semexprs.nim | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/compiler/semexprs.nim b/compiler/semexprs.nim index b80c4c8cb..8048111cd 100644 --- a/compiler/semexprs.nim +++ b/compiler/semexprs.nim @@ -2398,11 +2398,9 @@ proc semTupleFieldsConstr(c: PContext, n: PNode, flags: TExprFlags): PNode = typ.n = newNodeI(nkRecList, n.info) # nkIdentDefs var ids = initIntSet() for i in 0 ..< sonsLen(n): - if n[i].kind != nkExprColonExpr or n[i][0].kind notin {nkSym, nkIdent}: + if n[i].kind != nkExprColonExpr: illFormedAst(n.sons[i], c.config) - var id: PIdent - if n.sons[i].sons[0].kind == nkIdent: id = n.sons[i].sons[0].ident - else: id = n.sons[i].sons[0].sym.name + let id = considerQuotedIdent(c, n[i][0]) if containsOrIncl(ids, id.id): localError(c.config, n.sons[i].info, errFieldInitTwice % id.s) n.sons[i].sons[1] = semExprWithType(c, n.sons[i].sons[1], |