Backport "Fixes #24414: Fix StaleSymbolException in Namer.addChild after compilation suspension" to 3.3 LTS - #1058
Open
tgodzik wants to merge 2 commits into
Open
Backport "Fixes #24414: Fix StaleSymbolException in Namer.addChild after compilation suspension" to 3.3 LTS#1058tgodzik wants to merge 2 commits into
tgodzik wants to merge 2 commits into
Conversation
tgodzik
force-pushed
the
backport-lts-3.3-26227
branch
from
August 7, 2026 15:53
323cf93 to
0215e18
Compare
When `addChild` inspects a parent's existing Child annotations, forcing their lazy tree may dereference a child symbol from a previous run. If compilation was suspended (due to inline/macro processing) and the child class has been re-typechecked in the current run, the captured symbol is stale and accessing its owner triggers `StaleSymbol`. This manifests when a sealed parent is in a pre-compiled artifact and a subclass in user code uses an inline given that causes suspension: the parent's annotation list ends up holding a Child annotation pointing to the suspended-run version of the subclass. Treat such Child annotations as stale and drop them; the new run will have re-registered the child anyway. Fixes scala#24414 [Cherry-picked 3f30937]
Add a `NonStaleChild` extractor in `Annotations` that wraps `Child` with a `StaleSymbol` catch, and use it in `Namer.addChild` so the surrounding logic stays untouched. [Cherry-picked 05d29fd][modified]
tgodzik
force-pushed
the
backport-lts-3.3-26019
branch
from
August 7, 2026 15:54
decf07b to
7679064
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backports scala#26019 to the 3.3.9.
PR submitted by the release tooling.
[skip ci]