diff options
author | flywind <xzsflywind@gmail.com> | 2021-04-22 14:08:56 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-22 08:08:56 +0200 |
commit | 53c898de4105049c767804d0d2c520f31a86b874 (patch) | |
tree | 4303c3f00dc522dcbcc33dafaff7737b07f5d8f1 /tests | |
parent | fb32fff8dcf2b15a469e5cce07b10d88aa6352ee (diff) | |
download | Nim-53c898de4105049c767804d0d2c520f31a86b874.tar.gz |
fix #17812 (repr fails to compile with ARC/ORC) (#17816)
Diffstat (limited to 'tests')
-rw-r--r-- | tests/arc/t17812.nim | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/arc/t17812.nim b/tests/arc/t17812.nim new file mode 100644 index 000000000..bcd5f3a93 --- /dev/null +++ b/tests/arc/t17812.nim @@ -0,0 +1,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 |