mirror of
https://github.com/nim-lang/Nim.git
synced 2026-02-15 15:44:14 +00:00
Added notnil test for issue #1216
This commit is contained in:
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()
|
||||
Reference in New Issue
Block a user