Added notnil test for issue #1216
This commit is contained in:
parent
ec23f5ec0a
commit
a48c728ab3
1 changed files with 14 additions and 0 deletions
14
tests/notnil/tnotnil4.nim
Normal file
14
tests/notnil/tnotnil4.nim
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
discard ""
|
||||
type
|
||||
TObj = ref object
|
||||
|
||||
proc check(a: TObj not nil) =
|
||||
echo repr(a)
|
||||
|
||||
proc doit() =
|
||||
var x : array[0..1, TObj]
|
||||
|
||||
if x[0] != nil:
|
||||
check(x[0])
|
||||
|
||||
doit()
|
||||
Loading…
Add table
Add a link
Reference in a new issue