| 3529 | |
| 3530 | @staticmethod |
| 3531 | def make_normalized( |
| 3532 | item: Type, *, line: int = -1, column: int = -1, is_type_form: bool = False |
| 3533 | ) -> ProperType: |
| 3534 | item = get_proper_type(item) |
| 3535 | if is_type_form: |
| 3536 | # Don't convert TypeForm[X | Y] to (TypeForm[X] | TypeForm[Y]) |
| 3537 | pass |
| 3538 | else: |
| 3539 | if isinstance(item, UnionType): |
| 3540 | return UnionType.make_union( |
| 3541 | [TypeType.make_normalized(union_item) for union_item in item.items], |
| 3542 | line=line, |
| 3543 | column=column, |
| 3544 | ) |
| 3545 | return TypeType(item, line=line, column=column, is_type_form=is_type_form) # type: ignore[arg-type] |
| 3546 | |
| 3547 | def accept(self, visitor: TypeVisitor[T]) -> T: |
| 3548 | return visitor.visit_type_type(self) |