From 5ec6a3baef238be915ea6a52b457bc02aad2e239 Mon Sep 17 00:00:00 2001 From: TermiNexus Date: Tue, 18 Aug 2026 09:43:10 +0800 Subject: [PATCH] =?UTF-8?q?chore(gentype):=20resolve=5Fgeneric=5Ftype=5Fna?= =?UTF-8?q?me=20=E5=8A=A0=20T=20=E6=9B=BF=E6=8D=A2=E6=96=AD=E7=82=B9?= =?UTF-8?q?=EF=BC=8C=E5=AE=9A=E4=BD=8D=20list[str].get=20=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E4=B8=8D=E5=8C=B9=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 8fbba(ForHandleIter.vp 的 list[str].get)声明返回 i8* 但函数体 ret Value*——get 方法体里 T|t.CPtr 的 T 疑似被替换成 Value(泛型 上下文 GenericTypeArgs 被嵌套特化污染)。打印 T 替换结果确认。 --- App/lib/core/Gen/TypeGenBase.vp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/App/lib/core/Gen/TypeGenBase.vp b/App/lib/core/Gen/TypeGenBase.vp index ea17530..615d7a4 100644 --- a/App/lib/core/Gen/TypeGenBase.vp +++ b/App/lib/core/Gen/TypeGenBase.vp @@ -227,6 +227,7 @@ class TypeGenBase: """ if name is None: return name + rv_d: str = name if self.GenericTpNames is not None and self.GenericTypeArgs is not None: rg_n: t.CSizeT = len(self.GenericTpNames) rg_i: t.CSizeT @@ -235,5 +236,11 @@ class TypeGenBase: if rg_tpn is not None and string.strcmp(name, rg_tpn) == 0: rg_ta: str = self.GenericTypeArgs.get(rg_i) if rg_ta is not None: - return rg_ta - return name \ No newline at end of file + rv_d = rg_ta + break + # 诊断(8fbba list[str].get 返回类型不匹配定位):T 替换结果。 + # list[str] 特化时 T 应替换为 str;若替换为 Value 则泛型上下文 + # GenericTypeArgs 被嵌套特化污染。 + if string.strcmp(name, "T") == 0: + stdio.printf("[DIAG] resolve_generic_type_name: T -> %s\n", rv_d) + return rv_d \ No newline at end of file