修正了种子编译器的错误

This commit is contained in:
2026-07-22 21:55:36 +08:00
parent 135aa05485
commit ca7c2120b8
1185 changed files with 12056 additions and 2673 deletions

View File

@@ -163,6 +163,11 @@ class AssignHandle(BaseHandle):
if type_info.get('type') == 'CArray':
var_type_for_list = type_info.get('full_type')
Value: ir.Value | None = self.HandleExprLlvm(Node.value, VarType=var_type_for_list)
# 闭包变量追踪:当赋值右侧是返回闭包的函数调用时,记录变量为闭包类型
if isinstance(Node.value, ast.Call) and isinstance(Node.value.func, ast.Name):
CalledName: str = Node.value.func.id
if CalledName in Gen._closure_return_types:
Gen._closure_var_types[VarName] = Gen._closure_return_types[CalledName]
if not Value:
return
if isinstance(Value.type, ir.VoidType):