Skip to content

Fix regressions in asSeenFrom introduced in 3.7 #23438

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 1 commit into from
Jun 27, 2025

Conversation

smarter
Copy link
Member

@smarter smarter commented Jun 26, 2025

The body of isLegalPrefix used to read:

pre.isStable || !ctx.phase.isTyper

but was changed to drop the second condition in #21954 (originally included in 3.6.4-RC1, reverted from 3.6.4 final but back in 3.7). This has led to a number of regressions, the last ones discussed in #23423.

To make the testcases added in #21594 pass, this PR proposes a less drastic change: relax isLegalPrefix as before, unless we're doing an implicit search. This should dramatically reduce the possibility for regressions.

Fixes #23423.
Fixes #22676.

@noti0na1
Copy link
Member

Can you also add #22676 to a test? I tested your PR and it fixes the regression. Thanks!

The body of isLegalPrefix used to read:

    pre.isStable || !ctx.phase.isTyper

but was changed to drop the second condition in scala#21954 (originally included in
3.6.4-RC1, reverted from 3.6.4 final but back in 3.7). This has led to a
number of regressions, the last ones discussed in scala#23423.

To make the testcases added in scala#21594 pass, this PR proposes a less drastic
change: relax isLegalPrefix as before, unless we're doing an implicit search.
This should dramatically reduce the possibility for regressions.

Fixes scala#23423.
Fixes scala#22676.
@WojciechMazur WojciechMazur added the backport:nominated If we agree to backport this PR, replace this tag with "backport:accepted", otherwise delete it. label Jun 27, 2025
@smarter smarter requested a review from noti0na1 June 27, 2025 12:10
Copy link
Member

@noti0na1 noti0na1 left a comment

Choose a reason for hiding this comment

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

LGTM

@smarter smarter merged commit d27cf2d into scala:main Jun 27, 2025
49 of 50 checks passed
@smarter smarter deleted the fix-i23423-2 branch June 27, 2025 13:16
smarter added a commit to dotty-staging/dotty that referenced this pull request Jun 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:nominated If we agree to backport this PR, replace this tag with "backport:accepted", otherwise delete it.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Well-typed expression in quote fails to re-typecheck during inlining Regression crash in 3.6.4-RC1 posttyper
3 participants