diff --git a/App/lib/core/Gen/Type/TypeGenResolve.vp b/App/lib/core/Gen/Type/TypeGenResolve.vp index 33f4d20..a7611dd 100644 --- a/App/lib/core/Gen/Type/TypeGenResolve.vp +++ b/App/lib/core/Gen/Type/TypeGenResolve.vp @@ -1625,7 +1625,16 @@ class TypeGenResolve(TypeGenBase.TypeGenBase): return self.extract_class_name_from_annotation( sub.slice, imported_modules, pool, from_imports) return None - base_name: str = self.extract_class_name_from_annotation(sub.value, imported_modules, pool) + # [D25 根因修复] 递归取 base 时必须把 `from_imports` 一并下传: + # 此前这里丢掉了第 4 个参数,导致同一份注解在「派发名(本函数)/ + # 查表键(_resolve_generic_subscript_ty)/ 注册键(_specialize_generic_class)」 + # 三处算出的 mangled 名可能不同 —— 例如 `list[ast.AST | t.CPtr]` 的 + # 元素段在带/不带 from_imports 时规范化结果不一致,进而出现 + # 「alloca 是裸 list*、pass1 按 list[ast.ASTptr] 解释、pass2 按 + # list[ast.ClassDefptr] 解释」的分裂(MatchGenMixin._handle_renum_match + # 崩溃根因,见 Debugger/_Type.md D25)。其余调用点(1625、1650 等)均已传。 + base_name: str = self.extract_class_name_from_annotation( + sub.value, imported_modules, pool, from_imports) if base_name is None: return None # pool 不可用时,只返回裸类名(向后兼容)