修正了种子编译器的错误

This commit is contained in:
TermiNexus committed 2026-07-22 21:55:36 +08:00
1 parent 135aa05485
commit ca7c2120b8
1185 files changed
+12056 -2673

No files matched your search

+20
View File
@@ -0,0 +1,20 @@
import t
import ast
# ============================================================
# 回归测试:__slots__ + ast.AST 字段类型
# 验证 TPC 修复:无法识别的类型注解应报错终止,而非 VoidType alloca 崩溃
# 对照:使用 ast.expr(无效)会报错;使用 ast.AST(有效)应编译成功
# ============================================================
class Result:
__slots__ = ('elem_type_node', 'count_node', 'is_pointer')
def __init__(self, elem: ast.AST, count: ast.AST | t.CPtr, flag: bool) -> None:
self.elem_type_node: ast.AST = elem
self.count_node: ast.AST | t.CPtr = count
self.is_pointer: bool = flag
def main() -> int:
return 0