feat(selfhost): add &T (shared ref) and &mut T (mutable ref) type syntax
- Add tekRef and tekMutRef to TypeExpr enum (ast.bux) - Parse &T and &mut T in parserParseType, before *T handling (parser.bux) - Map tekRef/tekMutRef to tyPointer in HIR lowering (hir_lower.bux) - Both emit as T* in C backend (same as raw pointer) - Borrow checker rejects write-through-pointer in @[Checked] functions for all pointer types (safe default)
This commit is contained in:
+1
-1
@@ -53,7 +53,7 @@ func Lcx_ResolveTypeKindFromName(name: String) -> int {
|
||||
func Lcx_ResolveTypeKind(te: *TypeExpr) -> int {
|
||||
if te == null as *TypeExpr { return tyUnknown; }
|
||||
|
||||
if te.kind == tekPointer { return tyPointer; }
|
||||
if te.kind == tekPointer || te.kind == tekRef || te.kind == tekMutRef { return tyPointer; }
|
||||
if te.kind == tekSlice { return tySlice; }
|
||||
if te.kind == tekTuple { return tyTuple; }
|
||||
if te.kind == tekFunc { return tyFunc; }
|
||||
|
||||
Reference in New Issue
Block a user