summary refs log tree commit diff stats
path: root/tests/arc/tarcmisc.nim
diff options
context:
space:
mode:
authorringabout <43030857+ringabout@users.noreply.github.com>2024-04-18 17:57:44 +0800
committerGitHub <noreply@github.com>2024-04-18 17:57:44 +0800
commitacd4c8a3530c42143541b7d891aa61fd0af3f8d3 (patch)
treebb50e57ab2a84157b554b32a5a99fcd6f314d870 /tests/arc/tarcmisc.nim
parent49e1ca0b3e53709b993f63288a164cd843c70c82 (diff)
downloadNim-acd4c8a3530c42143541b7d891aa61fd0af3f8d3.tar.gz
fixes #23505; fixes injectdestructors errors on transformed addr (deref) refs (#23507)
fixes #23505
Diffstat (limited to 'tests/arc/tarcmisc.nim')
-rw-r--r--tests/arc/tarcmisc.nim13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/arc/tarcmisc.nim b/tests/arc/tarcmisc.nim
index d02db545a..2570e410f 100644
--- a/tests/arc/tarcmisc.nim
+++ b/tests/arc/tarcmisc.nim
@@ -714,3 +714,16 @@ block:
 
       let c: uint = 300'u
       doAssert $arrayWith(c, 3) == "[300, 300, 300]"
+
+block: # bug #23505
+  type
+    K = object
+    C = object
+      value: ptr K
+
+  proc init(T: type C): C =
+    let tmp = new K
+    C(value: addr tmp[])
+
+  discard init(C)
+