This commit is contained in:
Araq 2015-02-26 00:11:21 +01:00
commit 9053799bf5
5 changed files with 47 additions and 16 deletions

View file

@ -0,0 +1,27 @@
discard """
errormsg: "cannot prove 'x' is not nil"
"""
# bug #2216
type
A[T] = ref object
x: int
ud: T
proc good[T](p: A[T]) =
discard
proc bad[T](p: A[T] not nil) =
discard
proc go() =
let s = A[int](x: 1)
good(s)
bad(s)
var x: A[int]
bad(x)
go()