summary refs log blame commit diff stats
path: root/tests/notnil/tnotnil2.nim
blob: 6cd08de734ac8fef3ad16272b9782de47e78699f (plain) (tree)
1
2
3
4
5
6
7

                                         
         


               
                          





                            
         









                           
discard """
  errormsg: "cannot prove 'y' is not nil"
  line:20
"""

import strutils
{.experimental: "notnil".}

type
  TObj = object
    x, y: int

proc q(x: pointer not nil) =
  discard

proc p() =
  var x: pointer
  let y = x
  if not y.isNil or y != x:
    q(y)
  else:
    q(y)

p()