summary refs log tree commit diff stats
path: root/tests/compile/tforwardgeneric.nim
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2011-11-19 15:45:51 +0100
committerAraq <rumpf_a@web.de>2011-11-19 15:45:51 +0100
commita274f3bf5be3fc35f1538e5aab0e32fb9ed2ff82 (patch)
tree95dc5bf7fe3716a3ab266f78094fccce38c94ccf /tests/compile/tforwardgeneric.nim
parentd0772feb08baaea12bfdad0a7c20a41733f977bd (diff)
downloadNim-a274f3bf5be3fc35f1538e5aab0e32fb9ed2ff82.tar.gz
got rid of 'accept' dir in the tests
Diffstat (limited to 'tests/compile/tforwardgeneric.nim')
-rw-r--r--tests/compile/tforwardgeneric.nim11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/compile/tforwardgeneric.nim b/tests/compile/tforwardgeneric.nim
new file mode 100644
index 000000000..84bef15cc
--- /dev/null
+++ b/tests/compile/tforwardgeneric.nim
@@ -0,0 +1,11 @@
+discard """
+  output: "1.0000000000000000e+00 10"
+"""
+
+proc p[T](a, b: T): T
+
+echo p(0.9, 0.1), " ", p(9, 1)
+
+proc p[T](a, b: T): T =
+  result  = a + b
+
157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203