Skip to content

Allow processors to opt in to new features in Resolver - #3110

Merged
jaschdoc merged 5 commits into
mainfrom
opt-in-for-backing-fields
Aug 18, 2026
Merged

Allow processors to opt in to new features in Resolver#3110
jaschdoc merged 5 commits into
mainfrom
opt-in-for-backing-fields

Conversation

@jaschdoc

@jaschdoc jaschdoc commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator

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 the Resolver. The new lambda is introduced in SymbolProcessorEnvironment but does not break binary compatibility. The reason is that Resolver.getSymbolsWithAnnotation could 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.

Related to #2969
Related to #2472
Related to #2873

@jaschdoc
jaschdoc force-pushed the opt-in-for-backing-fields branch from 1cd08ac to ce2bb34 Compare August 3, 2026 11:03
@jaschdoc
jaschdoc force-pushed the opt-in-for-backing-fields branch 5 times, most recently from c780f78 to 5d8574c Compare August 7, 2026 07:51
@jaschdoc
jaschdoc force-pushed the opt-in-for-backing-fields branch from 98c7972 to c9d5fb1 Compare August 7, 2026 13:11
@jaschdoc
jaschdoc force-pushed the opt-in-for-backing-fields branch from c9d5fb1 to 7004516 Compare August 17, 2026 10:15
@jaschdoc jaschdoc changed the title Allow processors to opt in to new language features Allow processors to opt in to new features in Resolver Aug 17, 2026
@jaschdoc
jaschdoc force-pushed the opt-in-for-backing-fields branch from 7004516 to 3a32c68 Compare August 17, 2026 13:07
@jaschdoc
jaschdoc force-pushed the opt-in-for-backing-fields branch from 9f10926 to 84f1fd1 Compare August 18, 2026 10:30
@jaschdoc
jaschdoc requested a review from troelsbjerre August 18, 2026 10:30
@jaschdoc
jaschdoc merged commit 992e2d4 into main Aug 18, 2026
27 checks passed
@jaschdoc
jaschdoc deleted the opt-in-for-backing-fields branch August 18, 2026 11:30
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.

2 participants