summary refs log blame commit diff stats
path: root/tests/compile/timplictderef.nim
blob: 99b0b645be2b1709a414bce58634d0ba16056345 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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