diff options
author | ringabout <43030857+ringabout@users.noreply.github.com> | 2022-11-16 14:36:14 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-16 07:36:14 +0100 |
commit | 3d692d08f74e41588fa157b006e882f142bd77d4 (patch) | |
tree | ef3a51297b1ae323d37a85ffcd95d594874f4c50 /tests | |
parent | 4a3be7e29eb25b04a5542e7b92605c5ee24620bb (diff) | |
download | Nim-3d692d08f74e41588fa157b006e882f142bd77d4.tar.gz |
fixes a long-standing ARC bug (#20849)
* fixes an ARC bug * add a testcase
Diffstat (limited to 'tests')
-rw-r--r-- | tests/arc/tarcmisc.nim | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/arc/tarcmisc.nim b/tests/arc/tarcmisc.nim index 3160d8a4d..6435f5e94 100644 --- a/tests/arc/tarcmisc.nim +++ b/tests/arc/tarcmisc.nim @@ -546,3 +546,15 @@ proc fooz(sec: var InputSectionBase) = var sec = create(InputSection) sec[] = InputSection(relocations: newSeq[int]()) fooz sec[] + +block: + type + Data = ref object + id: int + proc main = + var x = Data(id: 99) + var y = x + x[] = Data(id: 778)[] + doAssert y.id == 778 + doAssert x[].id == 778 + main() |