修正了种子编译器的错误
This commit is contained in:
@@ -521,6 +521,11 @@ class AnnAssignHandle(BaseHandle):
|
||||
InitValue: ir.Value | None = None
|
||||
if Node.value:
|
||||
InitValue = self.HandleExprLlvm(Node.value, VarType=VarType)
|
||||
# 闭包变量追踪:当赋值右侧是返回闭包的函数调用时,记录变量为闭包类型
|
||||
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 VarName in Gen._reg_values:
|
||||
del Gen._reg_values[VarName]
|
||||
if VarName in Gen.variables and Gen.variables[VarName] is not None:
|
||||
|
||||
Reference in New Issue
Block a user