Files
Nim/tests/notnil/tnotnil_in_generic.nim
Adam Strzelecki e80465dacf tests: Trim .nim files trailing whitespace
via OSX: find . -name '*.nim' -exec sed -i '' -E 's/[[:space:]]+$//' {} +
2015-09-04 23:04:32 +02:00

28 lines
307 B
Nim

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