Skip to content

Strengthen check for inference type loops #2448

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
May 27, 2025
Merged

Strengthen check for inference type loops #2448

merged 5 commits into from
May 27, 2025

Conversation

swernli
Copy link
Collaborator

@swernli swernli commented May 22, 2025

This change updats the check we have in type inference to ensure an inference type is not bound to another type that includes itself. The previous check worked for simple cases where the target type directly contained the inference type, but fails to catch recursion where the target type contained inference types that indicrectly pointed to the original inference type through the current type inference solution. With this check in place, we can now explicitly give an error when a recursive type is detected.
Fixes #2426

This change updats the check we have in type inference to ensure an inference type is not bound to another type that includes itself. The previous check worked for simple cases where the target type directly contained the inference type, but fails to catch recursion where the target type contained inference types that indicrectly pointed to the original inference type through the current type inference solution. With this check in place, we can now explicitly give an error when a recursive type is detected.
Fixes #2426
@swernli swernli requested review from idavis and minestarks as code owners May 22, 2025 18:28
@swernli swernli added this pull request to the merge queue May 27, 2025
Merged via the queue into main with commit 58ca134 May 27, 2025
18 checks passed
@swernli swernli deleted the swernli/issue2426 branch May 27, 2025 22:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fuzz: "==5070== ERROR: libFuzzer: out-of-memory (used: 4204Mb; limit: 4096Mb)" (ubuntu-latest)
3 participants