diff --git a/App/lib/core/Gen/StructGenMixin.vp b/App/lib/core/Gen/StructGenMixin.vp index 40b28da..08f104a 100644 --- a/App/lib/core/Gen/StructGenMixin.vp +++ b/App/lib/core/Gen/StructGenMixin.vp @@ -854,12 +854,11 @@ class StructGenMixin: if string.strcmp(fe_q2.Name, field_name) == 0: stdlib.free(mod_buf_q) return fe_q2 - # 裸名类命中但字段未找到:可读化报错 - viperlib.snprintf(fb, 1024, - "lookup_field_by_class: 类 '%s' 裸名回退" - "(ModuleSha1=%s, FieldCount=%d)但字段 '%s' 未找到", - class_name, mod_sha1_q, same_entry_q.FieldCount, field_name) - self.Gen.TypeGenErr.fatal_error(node, fb, "AttributeError") + # 裸名类命中但字段未找到:返回 None(不 fatal_error)—— + # 字段可能是 REnum 变体别名(如 LLVMType.Pointee → _p2 + # 槽位)或继承字段,调用方(ExprGenAttr L853-864)有 + # REnum 别名回退等后续机会;对齐主 SHA1 匹配分支 + # (L797-798 字段未找到 return None)的语义。 stdlib.free(mod_buf_q) return None # 裸名也不唯一/不存在:fail-fast(暴露 vpi 注入/注册缺陷,