Files
ViperC/App
TermiNexus 78fc7313fb feat(gen): 同名全局 + 注解冲突优先报重复定义
- translate_annassign: 函数内(无 global/nonlocal、非模块级)再次注解同名变量时,若注解类型与模块级变量类型内容不一致 ⇒ TypeError 重复定义 fail-fast,不再延后到 RHS 的 coerce_to_type 报无关的「指针隐式转整数」(PointerTest/App/main.vp:46 _g_ptr: int = None,全局已是 t.CUInt32T | t.CPtr)

- 注解与全局一致时仍按 Python 语义遮蔽为独立局部变量(既有行为不变)

- 该检查走 _stg_ty_equal 内容比较(TypePrint),非地址比较,避免 Int32()/Ptr() 新实例造成误判
2026-09-27 08:50:18 +08:00
..