[ty] Improve diagnostic for failed assignment to a Callable type. by lerebear · Pull Request #25308 · astral-sh/ruff (original) (raw)
Summary
This improves the diagnostic we show when an assignment to a Callable type fails. That diagnostic now contains additional context that describes the inferred callable type that failed. The result is that the full explanation of the failed assignment is more coherent.
Closes astral-sh/ty#866.
Test Plan
Please see updated tests.
Typing conformance results
No changes detected ✅
Current numbers
The percentage of diagnostics emitted that were expected errors held steady at 91.94%. The percentage of expected errors that received a diagnostic held steady at 87.09%. The number of fully passing files held steady at 92/134.
Memory usage report
Memory usage unchanged ✅
lerebear changed the title
Improve diagnostic for failed assignment to a [ty] Improve diagnostic for failed assignment to a Callable type.Callable type.
lerebear marked this pull request as ready for review
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice!
It's so cool that we have this infrastructure now and it's so easy to add a contextual message like this; thank you @sharkdp !
lerebear deleted the lerebear/push-xqwxruqrnukq branch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
[ Show hidden characters]({{ revealButtonHref }})