Skip to content

[ty] Improve error context for incompatible callable signatures - #27422

Merged
AlexWaygood merged 1 commit into
mainfrom
alex/signature-context
Aug 2, 2026
Merged

[ty] Improve error context for incompatible callable signatures#27422
AlexWaygood merged 1 commit into
mainfrom
alex/signature-context

Conversation

@AlexWaygood

@AlexWaygood AlexWaygood commented Aug 2, 2026

Copy link
Copy Markdown
Member

Summary

We had a lot of branches in signatures.rs where we were failing to add error context, which often made our diagnostics less comprehensible than they could have been. This PR adds context to lots of these branches, and adds snapshots to cover the new code paths.

There are still lots of return self.never(); branches, even on this PR branch, that don't have any error context attached to them. I was too scared to touch the ParamSpec- and TypeVarTuple-specific branches in this PR 🙈 so left them out of scope for now.

@astral-sh-bot astral-sh-bot Bot added the ty Multi-file analysis & type inference label Aug 2, 2026
@AlexWaygood AlexWaygood added the diagnostics Related to reporting of diagnostics. label Aug 2, 2026
@astral-sh-bot

astral-sh-bot Bot commented Aug 2, 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 96.94%. The percentage of expected errors that received a diagnostic held steady at 92.21%. The number of fully passing files held steady at 101/133.

@astral-sh-bot

astral-sh-bot Bot commented Aug 2, 2026

Copy link
Copy Markdown

Memory usage report

Memory usage unchanged ✅

@astral-sh-bot

astral-sh-bot Bot commented Aug 2, 2026

Copy link
Copy Markdown

ecosystem-analyzer results

No diagnostic changes detected ✅

Full report with detailed diff (timing results)

@AlexWaygood
AlexWaygood force-pushed the alex/signature-context branch 2 times, most recently from f7e3afc to 65426a6 Compare August 2, 2026 20:54
info: the first parameter is missing
```

## Missing parameters in nested generic calls involving `TypeVarTuple`s and `ParamSpec`s

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these regression tests are added because an earlier version of the PR accidentally added subdiagnostics that were confusing/incorrect for these cases, which are meant to be out of scope for this PR

@AlexWaygood
AlexWaygood force-pushed the alex/signature-context branch from 65426a6 to ba9fe0f Compare August 2, 2026 20:58
@AlexWaygood
AlexWaygood force-pushed the alex/signature-context branch from ba9fe0f to 29c7c61 Compare August 2, 2026 21:01
@AlexWaygood
AlexWaygood marked this pull request as ready for review August 2, 2026 21:02
@AlexWaygood
AlexWaygood requested a review from a team as a code owner August 2, 2026 21:02
@astral-sh-bot
astral-sh-bot Bot requested a review from ibraheemdev August 2, 2026 21:02
@AlexWaygood
AlexWaygood merged commit 299a227 into main Aug 2, 2026
63 checks passed
@AlexWaygood
AlexWaygood deleted the alex/signature-context branch August 2, 2026 21:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

diagnostics Related to reporting of diagnostics. ty Multi-file analysis & type inference

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants