summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorLemonBoy <LemonBoy@users.noreply.github.com>2018-07-03 15:10:12 +0200
committerAndreas Rumpf <rumpf_a@web.de>2018-07-03 15:10:12 +0200
commitab47a870bce94cb33c66f2b27ecb1c62f48ae783 (patch)
treeb4d86f431110363c4962ba5fd343eb17e8143180 /tests
parent426e5c2d1f0c0a607fb5384f9ef700c45d3332f8 (diff)
downloadNim-ab47a870bce94cb33c66f2b27ecb1c62f48ae783.tar.gz
Error out if vararg match isn't an exact one (#8186)
Fixes #8172
Diffstat (limited to 'tests')
-rw-r--r--tests/typerel/t8172.nim11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/typerel/t8172.nim b/tests/typerel/t8172.nim
new file mode 100644
index 000000000..8e0b32932
--- /dev/null
+++ b/tests/typerel/t8172.nim
@@ -0,0 +1,11 @@
+discard """
+  line: 11
+  errormsg: "cannot convert array[0..0, string] to varargs[string]"
+"""
+
+proc f(v: varargs[string]) =
+  echo(v)
+
+f("b", "c")   # Works
+f(["b", "c"]) # Works
+f("b", ["c"]) # Fails