fixes #458
This commit is contained in:
parent
1c6ce881ec
commit
24955f8358
2 changed files with 7 additions and 4 deletions
|
|
@ -920,7 +920,7 @@ proc builtinFieldAccess(c: PContext, n: PNode, flags: TExprFlags): PNode =
|
||||||
result = check
|
result = check
|
||||||
elif ty.kind == tyTuple and ty.n != nil:
|
elif ty.kind == tyTuple and ty.n != nil:
|
||||||
f = getSymFromList(ty.n, i)
|
f = getSymFromList(ty.n, i)
|
||||||
if f != nil:
|
if f != nil:
|
||||||
n.sons[0] = makeDeref(n.sons[0])
|
n.sons[0] = makeDeref(n.sons[0])
|
||||||
n.sons[1] = newSymNode(f)
|
n.sons[1] = newSymNode(f)
|
||||||
n.typ = f.typ
|
n.typ = f.typ
|
||||||
|
|
@ -1582,6 +1582,7 @@ proc semTupleFieldsConstr(c: PContext, n: PNode, flags: TExprFlags): PNode =
|
||||||
flags*{efAllowDestructor})
|
flags*{efAllowDestructor})
|
||||||
var f = newSymS(skField, n.sons[i].sons[0], c)
|
var f = newSymS(skField, n.sons[i].sons[0], c)
|
||||||
f.typ = skipIntLit(n.sons[i].sons[1].typ)
|
f.typ = skipIntLit(n.sons[i].sons[1].typ)
|
||||||
|
f.position = i
|
||||||
rawAddSon(typ, f.typ)
|
rawAddSon(typ, f.typ)
|
||||||
addSon(typ.n, newSymNode(f))
|
addSon(typ.n, newSymNode(f))
|
||||||
n.sons[i].sons[0] = newSymNode(f)
|
n.sons[i].sons[0] = newSymNode(f)
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,8 @@
|
||||||
# Test various aspects
|
# Test various aspects
|
||||||
|
|
||||||
|
var x = (x: 42, y: (a: 8, z: 10))
|
||||||
|
echo x.y
|
||||||
|
|
||||||
import
|
import
|
||||||
mvarious
|
mvarious
|
||||||
|
|
||||||
|
|
@ -31,7 +34,7 @@ var
|
||||||
r.b.a.x = 0
|
r.b.a.x = 0
|
||||||
global = global + 1
|
global = global + 1
|
||||||
exportme()
|
exportme()
|
||||||
write(stdout, "Hallo wie heißt du? ")
|
write(stdout, "Hallo wie heißt du? ")
|
||||||
write(stdout, getPA().x)
|
write(stdout, getPA().x)
|
||||||
s = readLine(stdin)
|
s = readLine(stdin)
|
||||||
i = 0
|
i = 0
|
||||||
|
|
@ -39,5 +42,4 @@ while i < s.len:
|
||||||
if s[i] == 'c': write(stdout, "'c' in deinem Namen gefunden\n")
|
if s[i] == 'c': write(stdout, "'c' in deinem Namen gefunden\n")
|
||||||
i = i + 1
|
i = i + 1
|
||||||
|
|
||||||
write(stdout, "Du heißt " & s)
|
write(stdout, "Du heißt " & s)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue