summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorOscar Nihlgård <oscarnihlgard@gmail.com>2019-08-03 10:16:07 +0200
committerArne Döring <arne.doering@gmx.net>2019-08-03 10:16:07 +0200
commitbcfb540e576603019dd1ac76ba4f8c9774e05943 (patch)
treec5da6bf3c5090d9688f1b6bdb597136b7324158a /tests
parent50e921bb941d0f1ef728dfb4623f626015556e10 (diff)
downloadNim-bcfb540e576603019dd1ac76ba4f8c9774e05943.tar.gz
Allow typeof(nil) as generic parameter (#11869)
Diffstat (limited to 'tests')
-rw-r--r--tests/ccgbugs/tnil_type.nim13
1 files changed, 11 insertions, 2 deletions
diff --git a/tests/ccgbugs/tnil_type.nim b/tests/ccgbugs/tnil_type.nim
index 44ecf1cc9..b57e64513 100644
--- a/tests/ccgbugs/tnil_type.nim
+++ b/tests/ccgbugs/tnil_type.nim
@@ -2,5 +2,14 @@ discard """
   targets: "c cpp"
 """
 
-proc foo(v: type(nil)) = discard
-foo nil
+proc f1(v: typeof(nil)) = discard
+f1(nil)
+
+proc f2[T]() = discard
+f2[typeof(nil)]()
+
+proc f3(_: typedesc) = discard
+f3(typeof(nil))
+
+proc f4[T](_: T) = discard
+f4(nil)
\ No newline at end of file