diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2020-10-09 16:18:36 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-09 16:18:36 +0200 |
commit | d4302162885919d4b10a6d846a6f9d53ec9873eb (patch) | |
tree | ea721e4d05a2f09d9b964b74bb26e722ca66dd35 /tests/arc | |
parent | 16e8005031cdc017405ea0c85ddd03c7adf0cef0 (diff) | |
download | Nim-d4302162885919d4b10a6d846a6f9d53ec9873eb.tar.gz |
fixes #15532 (#15534)
Diffstat (limited to 'tests/arc')
-rw-r--r-- | tests/arc/tcaseobj.nim | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/arc/tcaseobj.nim b/tests/arc/tcaseobj.nim index 107cf9fc1..a967a509b 100644 --- a/tests/arc/tcaseobj.nim +++ b/tests/arc/tcaseobj.nim @@ -223,3 +223,24 @@ type MyObj = object var a = MyObj(kind: false, x0: 1234) a.kind = true doAssert(a.x1 == "") + +block: + # bug #15532 + type Kind = enum + k0, k1 + + type Foo = object + y: int + case kind: Kind + of k0: x0: int + of k1: x1: int + + const j0 = Foo(y: 1, kind: k0, x0: 2) + const j1 = Foo(y: 1, kind: k1, x1: 2) + + doAssert j0.y == 1 + doAssert j0.kind == k0 + doAssert j1.kind == k1 + + doAssert j1.x1 == 2 + doAssert j0.x0 == 2 |