summary refs log tree commit diff stats
path: root/tests/arc/t17812.nim
blob: bcd5f3a932f40d2aeee6f50962123e7694ce0350 (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
discard """
  targets: "c js"
  matrix: "--gc:refc; --gc:arc"
"""

import std/times

block: # bug #17812
  block:
    type
      Task = object
        cb: proc ()

    proc hello() = discard


    let t = Task(cb: hello)

    doAssert t.repr.len > 0


  block:
    type MyObj = object
      field: DateTime


    proc `$`(o: MyObj): string = o.repr

    doAssert ($MyObj()).len > 0