From 085fbcea6f054ec638250853c3e85a0e51c3f3bd Mon Sep 17 00:00:00 2001 From: Andreas Rumpf Date: Thu, 22 Aug 2019 18:57:41 +0200 Subject: [PATCH] fixes #10854 --- compiler/semexprs.nim | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/compiler/semexprs.nim b/compiler/semexprs.nim index b80c4c8cb6..8048111cde 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],