diff options
author | Araq <rumpf_a@web.de> | 2011-07-31 01:11:34 +0200 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2011-07-31 01:11:34 +0200 |
commit | 00da785f5dce911321f63230b7f87a7d143d2133 (patch) | |
tree | 5230cfc893dfd16b24ba33c093544f5806d270f0 /tests/accept | |
parent | 05cffb9370d05e810f30925a0b925f71ba6c2422 (diff) | |
download | Nim-00da785f5dce911321f63230b7f87a7d143d2133.tar.gz |
void type for generics
Diffstat (limited to 'tests/accept')
-rw-r--r-- | tests/accept/compile/tvoid.nim | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/accept/compile/tvoid.nim b/tests/accept/compile/tvoid.nim new file mode 100644 index 000000000..5ef076293 --- /dev/null +++ b/tests/accept/compile/tvoid.nim @@ -0,0 +1,13 @@ +discard """ + output: "he, no return type; a string" +""" + +proc ReturnT[T](): T = + when T is void: + echo "he, no return type;" + else: + result = " a string" + +ReturnT[void]() +echo ReturnT[string]() + |