mirror of
https://github.com/nim-lang/Nim.git
synced 2026-02-12 22:33:49 +00:00
bugfix: semantic checking: tuples without named fields
This commit is contained in:
@@ -662,7 +662,7 @@ proc builtinFieldAccess(c: PContext, n: PNode, flags: TExprFlags): PNode =
|
||||
check.sons[0] = n
|
||||
check.typ = n.typ
|
||||
result = check
|
||||
elif ty.kind == tyTuple:
|
||||
elif ty.kind == tyTuple and ty.n != nil:
|
||||
f = getSymFromList(ty.n, i)
|
||||
if f != nil:
|
||||
n.sons[0] = makeDeref(n.sons[0])
|
||||
|
||||
5
tests/reject/twrongtupleaccess.nim
Normal file
5
tests/reject/twrongtupleaccess.nim
Normal file
@@ -0,0 +1,5 @@
|
||||
# Bugfix
|
||||
|
||||
var v = (5.0, 10.0)
|
||||
v.setBLAH(10)
|
||||
|
||||
Reference in New Issue
Block a user