When unpickling, do not incorrectly set PureInterface flags #23944
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.
Previously, the behavior for setting
NoInits
andPureInterface
flags for class symbols inTreeInfo.defKind
(when compiling from a source) and inTreeUnpickler
(when reading Tasty) was inconsistent. This was problematic, as thePureInterface
flag dictated whether outer accessors were generated inExplicitOuter
phase (in theneedsOuterIfReferenced
method), so in the issue minimization, the inherited trait would have the outer accessors defined, and the inheriting object would then not implement them. This lead to runtimeMethodNotFound
errors.The problem was specifically with lazy vals, which were treated as if they did not have an rhs.
Fixes #23863
I've added an additional test case also testing the same adjusted method in the TreeUnpickler, as I've run into an issue with nested objects when testing a previous incorrect fix on the original linked minimisation with external dependencies (and no compiler tests would fail).