selfhost: add lib/Drop.bux with interface Drop; extend methods visible in scope

- lib/Drop.bux: interface Drop { func Drop(self: *Self); }
- sema.bux: define TypeName_MethodName in scope for impl block methods
  so auto-drop (Lcx_BuildAutoDropFree) can find Drop implementations
  via extend Type for Drop, not just @[Drop] or standalone functions
- Verified: extend Buffer for Drop auto-calls Buffer_Drop in @[Checked]
This commit is contained in:
2026-06-10 13:37:55 +03:00
parent 0a41ce85f4
commit 7d6cf7f511
2 changed files with 22 additions and 5 deletions
+4
View File
@@ -0,0 +1,4 @@
// Drop trait — automatic cleanup for heap-allocated or resource-holding types
interface Drop {
func Drop(self: *Self);
}