summary refs log blame commit diff stats
path: root/tests/ccgbugs/tcgbug.nim
blob: 1c6466c8776b5a36fe35e329c3f4257b73049df5 (plain) (tree)
1
2
3
4

                    
                   
   











                     
   



         
          

                                 
 
              
 









                                             
 
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]()