修正了种子编译器的错误

This commit is contained in:
2026-07-22 21:55:36 +08:00
parent 135aa05485
commit ca7c2120b8
1185 changed files with 12056 additions and 2673 deletions

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