fix(handles): _try_operator_overLoad fallback 补回 SpecClass 初始化,修 UnboundLocalError

This commit is contained in:
TermiNexus committed 2026-08-17 21:25:25 +08:00
1 parent fa2cfef205
commit dd95bf5bd4
1 file changed
+1
+1
View File
@@ -89,6 +89,7 @@ class ExprUtils:
# var_struct_class 仅记录裸模板名,但方法只在特化版本中定义。
# 选择策略:优先选 obj_val.type.pointee 实际匹配的特化;否则选第一个有方法的特化。
if '[' not in ClassName:
SpecClass: str | None = None
# 先收集所有候选特化(有方法 declare 或 define 的)
best_candidates: list[str] = []
for CN in Gen.structs.keys():