fix: 全量单测修复(flatten 健壮性 + 测试链路补 flatten + 断言对齐规范)

This commit is contained in:
2026-08-08 16:03:24 +08:00
parent 0bc8c847b5
commit d759338fd5
6 changed files with 25 additions and 17 deletions
+3 -1
View File
@@ -11,7 +11,9 @@ use oxide_ir::IRFunction;
use oxide_vm::vm::Vm;
fn run_ir(ir: IRFunction) -> String {
let module = oxide_ir::lower::lower(&ir).expect("lower failed");
let mut module = oxide_ir::lower::lower(&ir).expect("lower failed");
// 手工 IR 不经 Compiler::compile,需手动扁平化子模块(create_closure 相对索引)。
oxide_compiler::flatten::flatten_submodules(&mut module);
let mut vm = Vm::new();
match vm.run(&module) {
Ok(v) => format!("{v}"),