Skip to content

[ty] improve invariant matching of formal union vs inferable typevar#24698

Open
carljm wants to merge 1 commit intomainfrom
cjm/genfix
Open

[ty] improve invariant matching of formal union vs inferable typevar#24698
carljm wants to merge 1 commit intomainfrom
cjm/genfix

Conversation

@carljm
Copy link
Copy Markdown
Contributor

@carljm carljm commented Apr 17, 2026

Summary

Fixes astral-sh/ty#3277.

The real root cause here is astral-sh/ty#2799, but in this case there's a narrowly-targeted fix in the old constraint solver that improves behavior and doesn't seem to have downsides, so may as well land it.

Test Plan

Added mdtests.

@astral-sh-bot
Copy link
Copy Markdown

astral-sh-bot Bot commented Apr 17, 2026

Typing conformance results

No changes detected ✅

Current numbers
The percentage of diagnostics emitted that were expected errors held steady at 87.94%. The percentage of expected errors that received a diagnostic held steady at 83.36%. The number of fully passing files held steady at 79/133.

@astral-sh-bot
Copy link
Copy Markdown

astral-sh-bot Bot commented Apr 17, 2026

Memory usage report

Memory usage unchanged ✅

@astral-sh-bot
Copy link
Copy Markdown

astral-sh-bot Bot commented Apr 17, 2026

ecosystem-analyzer results

No diagnostic changes detected ✅

Full report with detailed diff (timing results)

@carljm carljm marked this pull request as ready for review April 17, 2026 15:45
@AlexWaygood AlexWaygood removed their request for review April 17, 2026 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ty Multi-file analysis & type inference

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Invalid argument type when overload self uses a different TypeVar than the class definition

2 participants