This commit is contained in:
Araq
2012-07-10 22:17:47 +02:00
parent 607f46a61a
commit 483f28d1cf
3 changed files with 21 additions and 3 deletions

View File

@@ -762,10 +762,11 @@ proc makeDeref(n: PNode): PNode =
result = newNodeIT(nkHiddenDeref, n.info, t.sons[0])
addSon(result, n)
t = skipTypes(t.sons[0], {tyGenericInst})
if t.kind in {tyPtr, tyRef}:
while t.kind in {tyPtr, tyRef}:
var a = result
result = newNodeIT(nkHiddenDeref, n.info, t.sons[0])
addSon(result, a)
t = skipTypes(t.sons[0], {tyGenericInst})
proc builtinFieldAccess(c: PContext, n: PNode, flags: TExprFlags): PNode =
## returns nil if it's not a built-in field access

View File

@@ -0,0 +1,18 @@
discard """
output: "2"
"""
type
TValue* {.pure, final.} = object of TObject
a: int
PValue = ref TValue
PPValue = ptr PValue
var x: PValue
new x
var sp: PPValue = addr x
sp.a = 2
if sp.a == 2: echo 2 # with sp[].a the error is gone

View File

@@ -1,7 +1,7 @@
version 0.9.0
=============
- change overloading resolution
- change overloading resolution: toop.nim test
- implicit ref/ptr->var conversion
- deprecate ``var x, y = 0`` as it's confusing for tuple consistency
- finish support for unsigned ints:
@@ -106,7 +106,6 @@ Library
Low priority
------------
- bignums
- change how comments are part of the AST
- ``with proc `+`(x, y: T): T`` for generic code
- new feature: ``distinct T with operations``