(self, ty: Type | None)
| 6072 | return self.accept(node, type_context=context, allow_none_return=allow_none_return) |
| 6073 | |
| 6074 | def _combined_context(self, ty: Type | None) -> Type | None: |
| 6075 | ctx_items = [] |
| 6076 | if ty is not None: |
| 6077 | if has_any_type(ty): |
| 6078 | # HACK: Any should be contagious, `dict[str, Any] or <x>` should still |
| 6079 | # infer Any in x. |
| 6080 | return ty |
| 6081 | ctx_items.append(ty) |
| 6082 | if self.type_context and self.type_context[-1] is not None: |
| 6083 | ctx_items.append(self.type_context[-1]) |
| 6084 | if ctx_items: |
| 6085 | return make_simplified_union(ctx_items) |
| 6086 | return None |
| 6087 | |
| 6088 | # |
| 6089 | # Helpers |
no test coverage detected