Skip to content

Delay normalization of capture sets of vals and defs#25640

Merged
odersky merged 4 commits intoscala:mainfrom
dotty-staging:fix-25622
Mar 28, 2026
Merged

Delay normalization of capture sets of vals and defs#25640
odersky merged 4 commits intoscala:mainfrom
dotty-staging:fix-25622

Conversation

@odersky
Copy link
Copy Markdown
Contributor

@odersky odersky commented Mar 27, 2026

Normalization means: Make all LocalCaps of a val or def sym have
origin InDecl(sym). Previously this was done immediately when an
element was included in a set. But that broke transaction semantics
since some additions could not be undone by removing the added element
from the set. We now do the same transformation as part of interpolation
after the definition is rechecked.

This is still OK, since the normalization is needed only for separation
checking

Fixes #25622

odersky added 3 commits March 27, 2026 10:20
Normalization means: Make all LocalCaps of a val or def `sym` have
origin InDecl(sym). Previously this was done immediately when an
element was included in a set. But that broke transaction semantics
since dome additions could not be undone by removing the added element
from the set. We now do the same transformation as part of interpolation
after the definition is rechecked.

This is still OK, since the normalization is needed only for separation
checking.

Fixes scala#25622
@odersky odersky requested a review from Linyxus March 28, 2026 13:28
Copy link
Copy Markdown
Contributor

@Linyxus Linyxus left a comment

Choose a reason for hiding this comment

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

LGTM!

@Linyxus
Copy link
Copy Markdown
Contributor

Linyxus commented Mar 28, 2026

Is this ready to be merged? Everything looks good.

@odersky odersky merged commit 83feab2 into scala:main Mar 28, 2026
64 checks passed
@odersky odersky deleted the fix-25622 branch March 28, 2026 21:04
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.

CC: Self type of class is unsoundly pure

2 participants