mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-28 17:04:41 +00:00
@@ -2432,7 +2432,7 @@ proc checkPar(c: PContext; n: PNode): TParKind =
|
||||
for i in 0..<n.len:
|
||||
if result == paTupleFields:
|
||||
if (n[i].kind != nkExprColonExpr) or
|
||||
n[i][0].kind notin {nkSym, nkIdent}:
|
||||
n[i][0].kind notin {nkSym, nkIdent, nkAccQuoted}:
|
||||
localError(c.config, n[i].info, errNamedExprExpected)
|
||||
return paNone
|
||||
else:
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
discard """
|
||||
output: '''
|
||||
output: '''(a: 1)
|
||||
(a: 1)
|
||||
(a: 1, b: 2)
|
||||
'''
|
||||
"""
|
||||
|
||||
@@ -75,3 +77,8 @@ block t1986:
|
||||
(var1: test(), var2: 100'u32),
|
||||
(var1: test(), var2: 192'u32)
|
||||
]
|
||||
|
||||
# bug #14911
|
||||
echo (a: 1) # works
|
||||
echo (`a`: 1) # works
|
||||
echo (`a`: 1, `b`: 2) # Error: named expression expected
|
||||
|
||||
Reference in New Issue
Block a user