summary refs log tree commit diff stats
path: root/tests/reject/tnotnil.nim
blob: b02e337136209dfadbe45a22d68b9c63c68399de (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
discard """
  line: 22
  errormgs: "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)