From ab47a870bce94cb33c66f2b27ecb1c62f48ae783 Mon Sep 17 00:00:00 2001 From: LemonBoy Date: Tue, 3 Jul 2018 15:10:12 +0200 Subject: Error out if vararg match isn't an exact one (#8186) Fixes #8172 --- tests/typerel/t8172.nim | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 tests/typerel/t8172.nim (limited to 'tests') 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 -- cgit 1.4.1-2-gfad0