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





                         
 
                           
 
                  



                                





                         
discard """
  line: 22
  errormsg: "type mismatch"
"""

type
  PObj = ref TObj not nil
  TObj = object
    x: int

  MyString = string not nil

#var x: PObj = nil

proc p(x: string not nil): int =
  result = 45

proc q(x: MyString) = nil
proc q2(x: string) = nil

q2(nil)
q(nil)