Skip to content

Commit

Permalink
fix: Fix pyre typing errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Daquiver1 committed Dec 6, 2023
1 parent 60331c0 commit 8f5d32a
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions projects/jdwp/codegen/dataclass_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,20 +63,20 @@ def format_enum_name(enum_value):

def nested_structs(root: Struct) -> typing.Generator[StructLink, None, None]:
for field in root.fields:
type = field.type
match type:
field_type = field.type
match field_type:
case Array():
array_type = typing.cast(Array, type)
array_type = typing.cast(Array, field_type)
yield root, field, array_type.element_type
yield from nested_structs(array_type.element_type)
case TaggedUnion():
tagged_union_type = typing.cast(TaggedUnion, type)
for struct in tagged_union_type.cases:
tagged_union_type = typing.cast(TaggedUnion, field_type)
for _, struct in tagged_union_type.cases:
yield root, field, struct
yield from nested_structs(struct)
case Struct():
yield root, field, type
yield from nested_structs(type)
yield root, field, field_type
yield from nested_structs(field_type)


def compute_struct_names(root: Struct, name: str) -> typing.Mapping[Struct, str]:
Expand Down

0 comments on commit 8f5d32a

Please sign in to comment.