diff --git a/App/lib/core/Gen/Call/CallGenDispatch.vp b/App/lib/core/Gen/Call/CallGenDispatch.vp index d4e9c57..03d6de6 100644 --- a/App/lib/core/Gen/Call/CallGenDispatch.vp +++ b/App/lib/core/Gen/Call/CallGenDispatch.vp @@ -608,6 +608,15 @@ novirtual class CallGenDispatch(CallGenBase.CallGenBase): return llvmlite.const_int64(pool, 8) if string.strncmp(sz_cls_name, "rawptr[", 7) == 0: return llvmlite.const_int64(pool, 8) + # 归一后的指针唯一规范形 `T*`(TypeGenResolve._norm_type_arg_name + # 的指针书写归一:rawptr[T] ≡ t.CPtr[T] ≡ T|t.CPtr ≡ T*) + # ⇒ 尾随 '*' 一律按指针大小 8。缺这条时 `T.__sizeof__()` + # 的实参串 `{sha}.AST*` 既不命中 '|' 也不命中 'rawptr[', + # 落回把接收者 Name(T) 当实例翻译 → NameError: 未定义名称 'T' + # (现场 Test/AstTest/App/main.vp:21 特化 list[ast.AST|t.CPtr] + # → includes/_list.vp:36 `self.__elem_size__ = T.__sizeof__()`)。 + if string.strrchr(sz_cls_name, '*') is not None: + return llvmlite.const_int64(pool, 8) # 保存完整名(含模块前缀)供模块归属精确匹配:去前缀后 # get_struct_type 裸名全局匹配会误命中跨模块同名类 # (w32.win32base.SECURITY_ATTRIBUTES 根因)。