chore(gentype): resolve_annotation_type 加 T 替换断点(方法体局部注解路径)
上一轮 resolve_generic_type_name 断点无输出——方法体局部注解 (elem_ptr: T|t.CPtr)的 T 替换走 resolve_annotation_type 的 Name(T) 分支(gen.GenericTypeArgs),非 resolve_generic_type_name。 在此打印 T 实际替换值,确认 list[str].get 的 T→str 还是 T→Value。
This commit is contained in:
1 parent
5ec6a3baef
commit
0f25dc1511
1 file changed
+3
@@ -963,6 +963,9 @@ class TypeGenResolve(TypeGenBase.TypeGenBase):
|
||||
if gp_tpn is not None and string.strcmp(nm.id, gp_tpn) == 0:
|
||||
gp_ta: str = self.GenericTypeArgs.get(gp_i)
|
||||
if gp_ta is not None:
|
||||
# 诊断(8fbba list[str].get 类型不匹配):方法体 T 替换
|
||||
# 的实际值。list[str] 特化时 T→str;T→Value 则上下文污染。
|
||||
stdio.printf("[DIAG] T 替换: %s -> %s\n", nm.id, gp_ta)
|
||||
# 自映射/污染实参防护(泛型循环套用):
|
||||
# 1) 实参与参数名完全一致(T→T)
|
||||
# 2) 实参串包含任一类型参数名(如 "T | t.CPtr"、" T "、
|
||||
|
||||
Reference in new issue
Block a user