Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[ty] Improve diagnostic for failed assignment to a Callable type.#25308

Merged
lerebear merged 3 commits into
mainfrom
lerebear/push-xqwxruqrnukq
May 29, 2026
Merged

[ty] Improve diagnostic for failed assignment to a Callable type.#25308
lerebear merged 3 commits into
mainfrom
lerebear/push-xqwxruqrnukq

Conversation

@lerebear

@lerebear lerebear commented May 21, 2026

Copy link
Copy Markdown
Contributor

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.

@astral-sh-bot astral-sh-bot Bot added the ty Multi-file analysis & type inference label May 21, 2026
@astral-sh-bot

astral-sh-bot Bot commented May 21, 2026

Copy link
Copy Markdown

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.

@astral-sh-bot

astral-sh-bot Bot commented May 21, 2026

Copy link
Copy Markdown

Memory usage report

Memory usage unchanged ✅

@astral-sh-bot

astral-sh-bot Bot commented May 21, 2026

Copy link
Copy Markdown

ecosystem-analyzer results

No diagnostic changes detected ✅

Full report with detailed diff (timing results)

@lerebear lerebear changed the title Improve diagnostic for failed assignment to a Callable type. [ty] Improve diagnostic for failed assignment to a Callable type. May 22, 2026
@lerebear lerebear force-pushed the lerebear/push-xqwxruqrnukq branch 2 times, most recently from 7b1ae10 to 5b64f99 Compare May 27, 2026 22:18
@codspeed-hq

codspeed-hq Bot commented May 27, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 65 untouched benchmarks
⏩ 60 skipped benchmarks1


Comparing lerebear/push-xqwxruqrnukq (5783757) with main (0fb46b2)

Open in CodSpeed

Footnotes

  1. 60 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@lerebear lerebear force-pushed the lerebear/push-xqwxruqrnukq branch 2 times, most recently from fee61bc to 0cf5aaf Compare May 27, 2026 23:22
@lerebear lerebear marked this pull request as ready for review May 28, 2026 22:05

@carljm carljm left a comment

Copy link
Copy Markdown
Contributor

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 !

Comment thread crates/ty_python_semantic/src/types/relation.rs Outdated
@lerebear lerebear force-pushed the lerebear/push-xqwxruqrnukq branch from 0cf5aaf to 5783757 Compare May 29, 2026 19:48
@lerebear lerebear merged commit a8aceb1 into main May 29, 2026
60 checks passed
@lerebear lerebear deleted the lerebear/push-xqwxruqrnukq branch May 29, 2026 20:51
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.

Improve diagnostics when a class literal is not assignable to a Callable type

2 participants