Files

21 lines
714 B
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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