Skip to content

[ty] Normalize dynamic class literals in cycle recovery#25558

Merged
charliermarsh merged 3 commits into
mainfrom
charlie/fix-ty-3627
Jun 2, 2026
Merged

[ty] Normalize dynamic class literals in cycle recovery#25558
charliermarsh merged 3 commits into
mainfrom
charlie/fix-ty-3627

Conversation

@charliermarsh

Copy link
Copy Markdown
Member

Summary

A dynamically created class can capture the previous value of a loop-carried variable in its members or bases. Prior to this change, we treated class literals as atomic during recursive type normalization, so the class's interned identity kept growing on each inference cycle and Salsa eventually panicked after too many cycle iterations.

Closes astral-sh/ty#3627.

@astral-sh-bot astral-sh-bot Bot added the ty Multi-file analysis & type inference label Jun 2, 2026
@charliermarsh charliermarsh added the bug Something isn't working label Jun 2, 2026
@astral-sh-bot

astral-sh-bot Bot commented Jun 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 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 Jun 2, 2026

Copy link
Copy Markdown

Memory usage report

Memory usage unchanged ✅

@astral-sh-bot

astral-sh-bot Bot commented Jun 2, 2026

Copy link
Copy Markdown

ecosystem-analyzer results

No diagnostic changes detected ✅

Flaky changes detected. This PR summary excludes flaky changes; see the HTML report for details.

Full report with detailed diff (timing results)

@charliermarsh charliermarsh marked this pull request as ready for review June 2, 2026 19:46
@charliermarsh charliermarsh merged commit 5ae9919 into main Jun 2, 2026
59 checks passed
@charliermarsh charliermarsh deleted the charlie/fix-ty-3627 branch June 2, 2026 19:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working ty Multi-file analysis & type inference

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Panic when inferring repeated dynamic type() reassignment inside a loop

2 participants