fix(struct): 修复 _Undefined 检查中的未定义变量 constant
列表初始化器中应检查元素 c.constant,原代码引用裸名 constant 导致 NameError。
This commit is contained in:
1 parent
de89b26bb7
commit
b6d6d5ac6b
1 file changed
+1
-1
@@ -942,7 +942,7 @@ class StructGenMixin:
|
||||
needs_fix = True
|
||||
elif isinstance(gv.initializer, ir.Constant):
|
||||
if isinstance(gv.initializer.constant, list):
|
||||
if any(hasattr(c, 'constant') and isinstance(constant, _Undefined) for c in gv.initializer.constant):
|
||||
if any(hasattr(c, 'constant') and isinstance(c.constant, _Undefined) for c in gv.initializer.constant):
|
||||
needs_fix = True
|
||||
if not needs_fix:
|
||||
continue
|
||||
|
||||
Reference in new issue
Block a user