diff --git a/App/lib/core/Gen/TypeGenMixin.vp b/App/lib/core/Gen/TypeGenMixin.vp index da82236..734aeae 100644 --- a/App/lib/core/Gen/TypeGenMixin.vp +++ b/App/lib/core/Gen/TypeGenMixin.vp @@ -1910,12 +1910,12 @@ class TypeGenMixin: other_cls_ty: llvmlite.LLVMType | t.CPtr = HandlesStruct.get_struct_type(other_cls_nm) if other_cls_ty is not None: return llvmlite.Ptr(pool, other_cls_ty) - # fail-fast:CPtr 标记下 other 侧类型完全无法解析, - # 不再静默退化为 i8*,暴露上游类型错误根因。 - # (t.CVoid | t.CPtr → i8* 的合法语义分支在 other_is_cvoid 处已提前返回) - HandlesType.fatal_error( - node, f"联合类型 '{HandlesType.annotation_to_str(node)}' 中类型无法解析", "NameError") - return llvmlite.Ptr(pool, llvmlite.Int8(pool)) # 不可达(fatal_error 已退出) + # 类名未注册:可能是前向自我引用(如 json 的 + # 'JsonValue' | t.CPtr 字段引用自身类,类体处理中 + # 尚未注册)或 Phase A-pre 依赖类延迟到下一遍注册。 + # 回退 Ptr(i8) 由 AnnotClassName 恢复 + 多遍注册收敛 + # 处理,禁止 fail-fast(误杀合法前向引用)。 + return llvmlite.Ptr(pool, llvmlite.Int8(pool)) return llvmlite.Ptr(pool, other_ty) # 无 CPtr 标记:返回第一个非 None(装饰器标记如 CExport/CExtern 被忽略)