NoOpImplementation improvements [1/3] Support for nested interfaces#3468
Merged
satween merged 2 commits intoMay 25, 2026
Merged
Conversation
### What does this PR do? Extends the NoOp code generator to handle interfaces declared as nested types inside other classes or interfaces. The processor now uses `toClassName()` from kotlinpoet-ksp for supertypes and introduces `noOpName()` to concatenate enclosing class names (e.g. `Outer.Inner` → `NoOpOuterInner`), avoiding collisions. Also fixes return-type and property-initializer resolution for nested interface types, and guards local interface declarations with `isLocal()` to prevent `IllegalArgumentException`. ### Motivation The processor previously used `ClassName(packageName, interfaceName)` for the supertype, which produced incorrect references for nested types and crashed on local interface declarations. Annotated nested interfaces are a valid pattern in the SDK's public API surface. ### Additional Notes Tests added for annotated nested interfaces, both-sides annotation, and nested return types. Stacked with a follow-up PR that adds a visibility guard for private/protected nested interfaces. ### Review checklist (to be filled by reviewers) - [ ] Feature or bugfix MUST have appropriate tests (unit, integration, e2e) - [ ] Make sure you discussed the feature or bugfix with the maintaining team in an Issue - [ ] Make sure each commit and the PR mention the Issue number (cf the [CONTRIBUTING](../CONTRIBUTING.md) doc)
Contributor
Author
Merged
3 tasks
NoOpImplementation improvements [1/2]Add NoOp generation support for nested interfaces
NoOpImplementation improvements [1/2]Add NoOp generation support for nested interfacesNoOpImplementation improvements [1/2] Support for nested interfaces
This comment has been minimized.
This comment has been minimized.
Rename BothAnnotatedNested.kt → Outer2.kt and InnerAnnotated.kt → Outer.kt to match the top-level class names they contain, as required by the standard:filename / MatchingDeclarationName rule. Update test parameter strings accordingly.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #3468 +/- ##
===========================================
+ Coverage 72.21% 72.22% +0.01%
===========================================
Files 964 964
Lines 35554 35554
Branches 5922 5922
===========================================
+ Hits 25673 25678 +5
- Misses 8263 8267 +4
+ Partials 1618 1609 -9 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3358f540e9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
kikoveiga
approved these changes
May 25, 2026
hamorillo
approved these changes
May 25, 2026
3 tasks
NoOpImplementation improvements [1/2] Support for nested interfacesNoOpImplementation improvements [1/3] Support for nested interfaces
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.

What does this PR do?
Extends the NoOp code generator to handle interfaces declared as nested types
inside other classes or interfaces. The processor now uses
toClassName()fromkotlinpoet-ksp for supertypes and introduces
noOpName()to concatenateenclosing class names (e.g.
Outer.Inner→NoOpOuterInner), avoidingcollisions. Also fixes return-type and property-initializer resolution for nested
interface types, and guards local interface declarations with
isLocal()toprevent
IllegalArgumentException.Motivation
The processor previously used
ClassName(packageName, interfaceName)for thesupertype, which produced incorrect references for nested types and crashed on
local interface declarations. Annotated nested interfaces are a valid pattern in
the SDK's public API surface.
Additional Notes
Tests added for annotated nested interfaces, both-sides annotation, and nested
return types. Stacked with a follow-up PR that adds a visibility guard for
private/protected nested interfaces.
Review checklist (to be filled by reviewers)