ruff
2185bec0 - [ty] Fixup restoration of multi-inference state in `type_expression.rs` (#23760)

Commit
77 days ago
[ty] Fixup restoration of multi-inference state in `type_expression.rs` (#23760) ## Summary Two small followups to d9daf6d430623a8a5dd25cb52a3b6f2af961b9cb: - A minor fix for a bug I introduced in that commit. We should reset `context.multi_inference` to the state it was previously in rather than hardcoding `false` here. This has real-world impact on `altair` (see the mypy_primer report) - Also detect invalid PEP-604 unions involving `types.GenericAlias` instances and objects that don't have `__or__` methods at runtime. These need to be special-cased in the same way as class-literal types, because of typeshed's very forgiving `types.GenericAlias.__or__` annotation: https://github.com/python/typeshed/blob/07ffb67b924d5f532f8b8b72a4902f58faae6aca/stdlib/types.pyi#L700-L702 ## Test Plan mdtests extended
Author
Parents
Loading