diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2019-01-15 10:15:27 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-15 10:15:27 +0100 |
commit | 05c52ff34f996bb44425bcc17ae3ae60ed896bef (patch) | |
tree | 7cee72dc7821d876e839b5ceaed9e11731e5c20b /tests | |
parent | 06a8b488111b6d3858706bec6b31b1e4609620ea (diff) | |
download | Nim-05c52ff34f996bb44425bcc17ae3ae60ed896bef.tar.gz |
fixes #10203 (#10290)
* fixes #10203 * make typredef test green again * fixes the regressions differently
Diffstat (limited to 'tests')
-rw-r--r-- | tests/objects/tobject.nim | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/objects/tobject.nim b/tests/objects/tobject.nim index 61ef7442e..fbf531c3d 100644 --- a/tests/objects/tobject.nim +++ b/tests/objects/tobject.nim @@ -17,3 +17,23 @@ suite "object basic methods": check($obj == "(foo: 1)") test "it should test equality based on fields": check(makeObj(1) == makeObj(1)) + +# bug #10203 + +type + TMyObj = TYourObj + TYourObj = object of RootObj + x, y: int + +proc init: TYourObj = + result.x = 0 + result.y = -1 + +proc f(x: var TYourObj) = + discard + +var m: TMyObj = init() +f(m) + +var a: TYourObj = m +var b: TMyObj = a |