Skip to content

Conversation

jchyb
Copy link
Contributor

@jchyb jchyb commented Sep 17, 2025

Previously, the behavior for setting NoInits and PureInterface flags for class symbols in TreeInfo.defKind (when compiling from a source) and in TreeUnpickler (when reading Tasty) was inconsistent. This was problematic, as the PureInterface flag dictated whether outer accessors were generated in ExplicitOuter phase (in the needsOuterIfReferenced 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 runtime MethodNotFound 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).

Previously, the behavior for setting `NoInits` and `PureInterface` flags
for class symbols in `TreeInfo.defKind` (when compiling from a source)
and in `TreeUnpickler` (when reading Tasty) was inconsistent.
This was problematic, as the `PureInterface` flag dictated whether outer
accessors were generated in `ExplicitOuter` phase (in
the `needsOuterIfReferenced` 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
runtime `MethodNotFound` errors.
The problem was specifically with lazy vals, which were treated as if
they did not have an rhs.
@som-snytt
Copy link
Contributor

This seems to be #23788

@jchyb
Copy link
Contributor Author

jchyb commented Sep 17, 2025

@som-snytt You are right, even the minimisation is basically the same

@jchyb jchyb closed this Sep 17, 2025
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.

Scala3 incremental compiler doesn't properly detect which classes should be recompiled when using Scalatest macros

2 participants