Skip to content

Commit

Permalink
precommit
Browse files Browse the repository at this point in the history
  • Loading branch information
armandobelardo committed Sep 10, 2024
1 parent 804fd20 commit 74c842a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,7 @@ def __init__(

self._non_union_types_with_self_referencing_dependencies = set()
for id, type in self.ir.types.items():
if (
type.shape.get_as_union().type != "union"
and type.shape.get_as_union().type != "undiscriminatedUnion"
):
if type.shape.get_as_union().type != "union" and type.shape.get_as_union().type != "undiscriminatedUnion":
for referenced_id in type.referenced_types:
referenced_type = self.ir.types[referenced_id]
# This referenced type is self-referential
Expand Down Expand Up @@ -158,7 +155,7 @@ def does_circularly_reference_itself(self, type_id: ir_types.TypeId) -> bool:

def get_non_union_circular_references(self) -> Set[ir_types.TypeId]:
return self._non_union_self_referencing_type_ids

def get_non_union_types_with_self_referencing_dependencies(self) -> Set[ir_types.TypeId]:
return self._non_union_types_with_self_referencing_dependencies

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,9 @@ def _must_import_after_current_declaration(self, type_name: ir_types.DeclaredTyp
type_id=type_name.type_id, other_type_id=type_id_to_reference
)

is_referencing_circular_reference = type_name.type_id in self._context.get_non_union_types_with_self_referencing_dependencies()
is_referencing_circular_reference = (
type_name.type_id in self._context.get_non_union_types_with_self_referencing_dependencies()
)
if is_referencing_circular_reference:
should_import_after = is_referencing_circular_reference

Expand Down

0 comments on commit 74c842a

Please sign in to comment.