summary refs log tree commit diff stats
path: root/tests/ccgbugs/tcgbug.nim
blob: 92e7b3a66e0041a3e453d835c0e6824e85b3834e (plain) (blame)
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
36
37
38
discard """
  file: "tcgbug.nim"
  output: "success"
"""

type
  TObj = object
    x, y: int
  PObj = ref TObj

proc p(a: PObj) =
  a.x = 0

proc q(a: var PObj) =
  a.p()

var 
  a: PObj
new(a)
q(a)

# bug #914
when defined(windows):
  var x = newWideCString("Hello")

echo "success"


# bug #833

type
  PFuture*[T] = ref object
    value*: T
    finished*: bool
    cb: proc (future: PFuture[T]) {.closure.}

var k = PFuture[void]()