Allow processors to opt in to new features in Resolver - #3110
Merged
Conversation
jaschdoc
force-pushed
the
opt-in-for-backing-fields
branch
from
August 3, 2026 11:03
1cd08ac to
ce2bb34
Compare
jaschdoc
force-pushed
the
opt-in-for-backing-fields
branch
5 times, most recently
from
August 7, 2026 07:51
c780f78 to
5d8574c
Compare
jaschdoc
force-pushed
the
opt-in-for-backing-fields
branch
from
August 7, 2026 13:11
98c7972 to
c9d5fb1
Compare
jaschdoc
force-pushed
the
opt-in-for-backing-fields
branch
from
August 17, 2026 10:15
c9d5fb1 to
7004516
Compare
jaschdoc
force-pushed
the
opt-in-for-backing-fields
branch
from
August 17, 2026 13:07
7004516 to
3a32c68
Compare
jaschdoc
commented
Aug 17, 2026
jaschdoc
force-pushed
the
opt-in-for-backing-fields
branch
from
August 17, 2026 13:11
3a32c68 to
de49c11
Compare
jaschdoc
force-pushed
the
opt-in-for-backing-fields
branch
from
August 17, 2026 13:19
de49c11 to
9f10926
Compare
jaschdoc
marked this pull request as ready for review
August 18, 2026 08:10
troelsbjerre
requested changes
Aug 18, 2026
This commit updates the default constructor but also introduces a new constructor which mirrors the old one, thereby maintaining binary compatibility.
jaschdoc
force-pushed
the
opt-in-for-backing-fields
branch
from
August 18, 2026 10:30
9f10926 to
84f1fd1
Compare
troelsbjerre
approved these changes
Aug 18, 2026
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.
This PR addresses the situation where a unchanged processor changes its behavior because it relies on
Resolver. The idea is that the processor gets a lambda that registers it for new features in theResolver. The new lambda is introduced inSymbolProcessorEnvironmentbut does not break binary compatibility. The reason is thatResolver.getSymbolsWithAnnotationcould start returning backing fields and context parameters, however, this flag allows the Resolver to adapt its behavior (at runtime) depending on whether or not the current processor has registered itself for new features. In this design, a processor that has chosen not to opt in can coexist with a processor that has opted in.SymbolProcessorEnvironmentwith a lambda that allows processors to register for new features inResolver. This alleviates the problem thatResolver.getSymbolsWithAnnotationchanges its behavior whenKSBackingFieldandKSContextParameteris properly introduced.ResolverAAImplto adapt according to the current processor's opt-in choice.AnnotationResolutionStrategyimplementations with feature flag. See Add support for new language features inAnnotationResolutionStrategyimplementations #3131Related to #2969
Related to #2472
Related to #2873