From b5df82319186595b2cc35678203a0992588dca8c Mon Sep 17 00:00:00 2001 From: flywind <43030857+xflywind@users.noreply.github.com> Date: Fri, 30 Oct 2020 16:55:21 +0800 Subject: add testcase for #9091 (#15791) * add testcase for #9091 * more tests --- tests/stdlib/t9091.nim | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 tests/stdlib/t9091.nim diff --git a/tests/stdlib/t9091.nim b/tests/stdlib/t9091.nim new file mode 100644 index 000000000..8419479a7 --- /dev/null +++ b/tests/stdlib/t9091.nim @@ -0,0 +1,36 @@ +discard """ + targets: "c" + output: "test AObj" + action: "compile" + exitcode: 0 + timeout: 60.0 +""" +import streams + +block: + type Mine = ref object + a: int + + proc write(io: Stream, t: Mine) = + io.write("sure") + + let str = newStringStream() + let mi = new Mine + + str.write(mi) + +block: + type + AObj = object + x: int + + proc foo(a: int): string = "" + + proc test(args: varargs[string, foo]) = + echo "varargs" + + proc test(a: AObj) = + echo "test AObj" + + let x = AObj() + test(x) -- cgit 1.4.1-2-gfad0