From a48c728ab3f8d3b0a3357d62b352d9913a600d9e Mon Sep 17 00:00:00 2001 From: Clay Sweetser Date: Wed, 18 Jun 2014 17:47:37 -0400 Subject: [PATCH] Added notnil test for issue #1216 --- tests/notnil/tnotnil4.nim | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 tests/notnil/tnotnil4.nim diff --git a/tests/notnil/tnotnil4.nim b/tests/notnil/tnotnil4.nim new file mode 100644 index 0000000000..23968ee488 --- /dev/null +++ b/tests/notnil/tnotnil4.nim @@ -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() \ No newline at end of file