summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorClay Sweetser <clay.sweetser@gmail.com>2014-06-18 17:47:37 -0400
committerClay Sweetser <clay.sweetser@gmail.com>2014-06-18 17:47:37 -0400
commita48c728ab3f8d3b0a3357d62b352d9913a600d9e (patch)
tree67aa43f9d2f60931c9c1993194f6a8fa4e03d5ba
parentec23f5ec0a5d65a8aca2dadddf052852f53d83ba (diff)
downloadNim-a48c728ab3f8d3b0a3357d62b352d9913a600d9e.tar.gz
Added notnil test for issue #1216
-rw-r--r--tests/notnil/tnotnil4.nim14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/notnil/tnotnil4.nim b/tests/notnil/tnotnil4.nim
new file mode 100644
index 000000000..23968ee48
--- /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