fix ai修复出现的stage2和stage3问题

This commit is contained in:
zzy committed 2026-11-13 22:15:07 +08:00
1 parent 50ee126d44
commit 936a8d0e88
19 files changed
+667 -679

No files matched your search

+2 -1
View File
@@ -77,7 +77,7 @@ fn clone_ref(b: *Bld.HirNodeContainer, s: *CloneState, r: Ref): Ref {
.FieldDecl(x) => { k = .FieldDecl(.{ .name = x.name, .ty = clone_ref(b, s, x.ty) }); },
.VarDecl(x) => { k = .VarDecl(.{ .is_comptime = x.is_comptime, .name = x.name, .ty = clone_ref(b, s, x.ty), .init = clone_ref(b, s, x.init) }); },
.ConstDecl(x) => { k = .ConstDecl(.{ .is_comptime = x.is_comptime, .name = x.name, .ty = clone_ref(b, s, x.ty), .init = clone_ref(b, s, x.init) }); },
.Alloc(x) => { k = .Alloc(.{ .ty = clone_ref(b, s, x.ty), .value = clone_ref(b, s, x.value) }); },
.Alloc(x) => { k = .Alloc(.{ .ty = clone_ref(b, s, x.ty), .value = clone_ref(b, s, x.value), .is_const = x.is_const }); },
.Block(x) => { k = .Block(.{ .stmts = clone_refs(b, s, x.stmts), .tail = clone_ref(b, s, x.tail) }); },
.If(x) => { k = .If(.{ .cond = clone_ref(b, s, x.cond), .then = clone_ref(b, s, x.then), .els = clone_ref(b, s, x.els), .ret_ty = clone_ref(b, s, x.ret_ty) }); },
.IfVar(x) => { k = .IfVar(.{ .pattern = clone_ref(b, s, x.pattern), .init = clone_ref(b, s, x.init), .then = clone_ref(b, s, x.then), .els = clone_ref(b, s, x.els) }); },
@@ -108,6 +108,7 @@ fn clone_ref(b: *Bld.HirNodeContainer, s: *CloneState, r: Ref): Ref {
.PatList(xs) => { k = .PatList(clone_refs(b, s, xs)); },
.PatTuple(xs) => { k = .PatTuple(clone_refs(b, s, xs)); },
.PatField(x) => { k = .PatField(.{ .name = x.name, .sub = clone_ref(b, s, x.sub) }); },
.PatFields(xs) => { k = .PatFields(clone_refs(b, s, xs)); },
.AggType(x) => {
k = .AggType(.{ .kind = x.kind, .conforms = clone_refs(b, s, x.conforms),
.fields = clone_refs(b, s, x.fields),