feat(selfhost): @[Checked] borrow checker — basic write-through-ptr detection

- Add isChecked field to Decl struct (ast.bux)
- Parse @[Checked] attribute in parserParseDecl (parser.bux)
- Add checkedFunc flag and movedVars to Sema struct (sema.bux)
- Enable borrow checking per-function in Sema_Analyze
- Reject assignment through raw pointer (*T) in @[Checked] functions
- Skip newlines between @[Checked] attribute and the declaration keyword
  to avoid parser seeing the attribute and function as separate decls
This commit is contained in:
2026-06-09 17:25:28 +03:00
parent c14578d9dd
commit 81281cbb11
3 changed files with 56 additions and 4 deletions
+1
View File
@@ -250,6 +250,7 @@ struct Decl {
column: uint32,
isPublic: bool,
isAsync: bool,
isChecked: int, // @[Checked] attribute (0/1)
// Names
strValue: String, // decl name
strValue2: String, // interface name, dll name, module path