diff --git a/App/lib/core/Gen/ExprGenMixin.vp b/App/lib/core/Gen/ExprGenMixin.vp index d48be59..b83b612 100644 --- a/App/lib/core/Gen/ExprGenMixin.vp +++ b/App/lib/core/Gen/ExprGenMixin.vp @@ -3122,13 +3122,11 @@ class ExprGenMixin: return llvmlite.Ptr(pool, i8_ty_d) if string.strstr(struct_name, "list[CPtr]") is not None: return llvmlite.Ptr(pool, i8_ty_d) - # fail-fast:未知 list[T] 元素类型无法映射 LLVM 类型,立即终止编译 - # (不再静默回退 Ptr(i8),暴露上游元素类型缺失根因) - HandlesType.fatal_error( - None, - f"list 元素类型未知:'{struct_name}' 无法映射 LLVM 类型", - "TypeError") - return None + # 未知 list[T] 元素类型(如 list[Foo]、list[AST|t.CPtr]):元素存储为 + # 8 字节槽(指针或 8 字节整数),回退 Ptr(i8) 位宽一致(load 8 字节), + # 由 AnnotClassName/特化恢复机制保证语义。禁止 fail-fast(误杀合法 + # 自定义类元素列表的下标访问)。 + return llvmlite.Ptr(pool, i8_ty_d) # ============================================================ # list_setitem_inline — 内联生成 list[T] __setitem__ 逻辑