diff options
author | flywind <43030857+xflywind@users.noreply.github.com> | 2020-10-30 16:55:21 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-30 09:55:21 +0100 |
commit | b5df82319186595b2cc35678203a0992588dca8c (patch) | |
tree | f652156b3b3e294a4ba48db69a35a74772ea2eca | |
parent | f79ded3cb6a1a8eb754081fca6b074bef455224e (diff) | |
download | Nim-b5df82319186595b2cc35678203a0992588dca8c.tar.gz |
add testcase for #9091 (#15791)
* add testcase for #9091 * more tests
-rw-r--r-- | tests/stdlib/t9091.nim | 36 |
1 files changed, 36 insertions, 0 deletions
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) |