fix(tests): serialize alias statements

This commit is contained in:
2026-07-01 14:13:27 +02:00
parent e2abc04fe4
commit 663642ea6c

View File

@@ -1,6 +1,7 @@
from typing import Optional, Sequence
from midas.ast.midas import (
AliasStmt,
BinaryExpr,
CallExpr,
ComplexType,
@@ -61,6 +62,13 @@ class MidasAstJsonSerializer(
"bound": self._serialize_optional(param.bound),
}
def visit_alias_stmt(self, stmt: AliasStmt) -> dict:
return {
"_type": "AliasStmt",
"name": stmt.name.lexeme,
"type": stmt.type.accept(self),
}
def visit_member_stmt(self, stmt: MemberStmt) -> dict:
return {
"_type": "MemberStmt",