| 4036 | |
| 4037 | |
| 4038 | class CollectAliasesVisitor(TypeQuery[list[mypy.nodes.TypeAlias]]): |
| 4039 | def __init__(self) -> None: |
| 4040 | super().__init__() |
| 4041 | self.seen_alias_nodes: set[mypy.nodes.TypeAlias] = set() |
| 4042 | |
| 4043 | def strategy(self, items: list[list[mypy.nodes.TypeAlias]]) -> list[mypy.nodes.TypeAlias]: |
| 4044 | out = [] |
| 4045 | for item in items: |
| 4046 | out.extend(item) |
| 4047 | return out |
| 4048 | |
| 4049 | def visit_type_alias_type(self, t: TypeAliasType, /) -> list[mypy.nodes.TypeAlias]: |
| 4050 | assert t.alias is not None |
| 4051 | if t.alias not in self.seen_alias_nodes: |
| 4052 | self.seen_alias_nodes.add(t.alias) |
| 4053 | res = [t.alias] + t.alias.target.accept(self) |
| 4054 | else: |
| 4055 | res = [] |
| 4056 | for arg in t.args: |
| 4057 | res.extend(arg.accept(self)) |
| 4058 | return res |
| 4059 | |
| 4060 | |
| 4061 | def is_named_instance(t: Type, fullnames: str | tuple[str, ...]) -> TypeGuard[Instance]: |
no outgoing calls
no test coverage detected
searching dependent graphs…