From 4c350bddacf1f63d283828ff2fd5f0142847f2d6 Mon Sep 17 00:00:00 2001 From: Christian Abrokwa Date: Wed, 29 Nov 2023 16:27:14 +0000 Subject: [PATCH] Updated types --- projects/jdwp/codegen/dataclass_generator.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/projects/jdwp/codegen/dataclass_generator.py b/projects/jdwp/codegen/dataclass_generator.py index caca420..54259d1 100644 --- a/projects/jdwp/codegen/dataclass_generator.py +++ b/projects/jdwp/codegen/dataclass_generator.py @@ -64,7 +64,7 @@ def nested_structs(root: Struct) -> typing.Generator[StructLink, None, None]: type = field.type match type: case Array(): - yield root, field, type.element_type + yield root, field, typing.cast(Array, type).element_type yield from nested_structs(typing.cast(Array, type).element_type) case TaggedUnion(): for struct in typing.cast(TaggedUnion, type).cases.values(): @@ -85,7 +85,7 @@ def compute_struct_names(root: Struct, name: str) -> typing.Mapping[Struct, str] case Array(): names[nested] = f"{names[parent]}{field.name.capitalize()}Element" case TaggedUnion(): - for case_value, case_struct in field.type.cases.items(): + for case_value, case_struct in typing.cast(TaggedUnion, type).cases.items(): case_name = format_enum_name(case_value) names[ case_struct