feat: 捕获 cell 换键——类合成 cell 切计数器分配,类名与函数声明改可见绑定索引

This commit is contained in:
2026-10-05 17:05:08 +00:00
parent 1144b07534
commit 6cb7964764
4 changed files with 29 additions and 28 deletions
@@ -164,7 +164,7 @@ impl Emitter {
ctx.nested.push(sub_module);
ctx.inst(Inst::create_closure(Operand::Reg(reg), ctx.nested.len() as u16));
if write_slot {
if let Some(&cell_idx) = ctx.captured_bindings.get(name) {
if let Some((cell_idx, _)) = ctx.visible_cell(name) {
ctx.inst(Inst::new(
OpCode::MAKE_CELL,
Operand::Reg(reg),