summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorflywind <43030857+xflywind@users.noreply.github.com>2020-10-30 16:55:21 +0800
committerGitHub <noreply@github.com>2020-10-30 09:55:21 +0100
commitb5df82319186595b2cc35678203a0992588dca8c (patch)
treef652156b3b3e294a4ba48db69a35a74772ea2eca
parentf79ded3cb6a1a8eb754081fca6b074bef455224e (diff)
downloadNim-b5df82319186595b2cc35678203a0992588dca8c.tar.gz
add testcase for #9091 (#15791)
* add testcase for #9091

* more tests
-rw-r--r--tests/stdlib/t9091.nim36
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)