diff options
author | Dean Thompson <deansherthompson@gmail.com> | 2019-01-21 16:40:04 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-21 16:40:04 -0500 |
commit | a6de0274ee768d135bab280d2b2700a0bb475300 (patch) | |
tree | 176b91e837ab7d2217713665c16fc28163017960 /tests/objects/tobject.nim | |
parent | 5b39c7aca91c1d20eb81425cf8f3854876aed475 (diff) | |
parent | ee89ba6bdb664fe4972f2917499cff1afdac0bab (diff) | |
download | Nim-a6de0274ee768d135bab280d2b2700a0bb475300.tar.gz |
Merge pull request #1 from nim-lang/devel
Getting the latest from nim-lang
Diffstat (limited to 'tests/objects/tobject.nim')
-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 |