test(drop): verify auto-drop works without @[Checked]

This commit is contained in:
2026-06-11 01:09:23 +03:00
parent b549e09a3b
commit aa2d6f9632
+15
View File
@@ -0,0 +1,15 @@
@[Drop]
struct Buffer {
ptr: *int
}
func Buffer_Drop(self: *Buffer) {
bux_free(self.ptr as *void);
}
func main() -> int {
let buf: Buffer = Buffer { ptr: bux_alloc(10 as uint * sizeof(int)) as *int };
// Buffer should be auto-dropped here via Buffer_Drop(&buf)
return 0;
}