fixes #23505; fixes injectdestructors errors on transformed addr (deref) refs (#23507)

fixes #23505
This commit is contained in:
ringabout
2024-04-18 17:57:44 +08:00
committed by GitHub
parent 49e1ca0b3e
commit acd4c8a353
2 changed files with 17 additions and 1 deletions

View File

@@ -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)