summary refs log tree commit diff stats
path: root/tests/misc/t9091.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/misc/t9091.nim')
-rw-r--r--tests/misc/t9091.nim33
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/misc/t9091.nim b/tests/misc/t9091.nim
new file mode 100644
index 000000000..6e7a98ca5
--- /dev/null
+++ b/tests/misc/t9091.nim
@@ -0,0 +1,33 @@
+# bug #9091
+
+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)
+  str.setPosition 0
+  doAssert str.readAll == "sure"
+
+block:
+  type
+    AObj = object
+      x: int
+
+  proc foo(a: int): string = ""
+
+  proc test(args: varargs[string, foo]) =
+    doAssert false
+
+  proc test(a: AObj) =
+    discard
+
+  let x = AObj()
+  test(x)