summary refs log tree commit diff stats
path: root/tests/mmaptest.nim
Commit message (Expand)AuthorAgeFilesLines
* bugfix: threading on PowerPCAraq2012-02-021-0/+48
ous revision' href='/ahoang/Nim/blame/tests/compile/timplictderef.nim?h=devel&id=607f46a61afebc7a9e1ab7c66570b6573d91ff6c'>^
865d341b3 ^

483f28d1c ^


865d341b3 ^
483f28d1c ^











865d341b3 ^















1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
           

              


    
                                             











                                                     















                                   
discard """
  output: '''2
88'''
"""

type
  TValue* {.pure, final.} = object of RootObj
    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

# Test the new auto-deref a little

{.experimental.}

proc p(x: var int; y: int) = x += y

block:
  var x: ref int
  new(x)

  x.p(44)

  var indirect = p
  x.indirect(44)

  echo x[]