summary refs log tree commit diff stats
path: root/tests/stdlib/t9091.nim
blob: 8419479a7f5f03d4393df35458a2501c77979950 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
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)