NoOpImplementation improvements [2/3] Guard NoOp generation against restricted-visibility#3469
Merged
satween merged 1 commit intoMay 26, 2026
Conversation
Contributor
Author
3 tasks
This comment has been minimized.
This comment has been minimized.
NoOpImplementation improvements [2/2] Guard NoOp generation against restricted-visibility
f61ae7b to
aa3d9ad
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #3469 +/- ##
===========================================
+ Coverage 72.16% 72.24% +0.08%
===========================================
Files 964 964
Lines 35554 35554
Branches 5922 5922
===========================================
+ Hits 25654 25684 +30
+ Misses 8282 8262 -20
+ Partials 1618 1608 -10 🚀 New features to boost your workflow:
|
kikoveiga
previously approved these changes
May 25, 2026
hamorillo
previously approved these changes
May 25, 2026
Base automatically changed from
tvaleev/feature/add-noop-generation-support-for-nested
to
develop
May 25, 2026 12:52
The base branch was changed.
Adds an `isPrivateOrHasPrivateEnclosing()` check that walks the enclosing-class chain and skips NoOp generation when any class in the chain has private or protected visibility, preventing the emission of uncompilable code. Without this guard, the NoOp generator introduced in the previous PR would attempt to implement nested interfaces that are not accessible from outside the enclosing type, causing compilation errors. Extends the test matrix with all 12 outer × inner visibility combinations: `public`/`internal` outer × `public`/`internal` inner → generation expected; `public`/`internal` outer × `private`/`protected` inner → generation skipped; `private` outer × any inner visibility → generation skipped. Stacked on "Add NoOp generation support for nested interfaces". - [ ] 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)
aa3d9ad to
9309cd7
Compare
3 tasks
NoOpImplementation improvements [2/2] Guard NoOp generation against restricted-visibilityNoOpImplementation improvements [2/3] Guard NoOp generation against restricted-visibility
0xnm
approved these changes
May 26, 2026
| # NoOp test fixtures use compound filenames (OuterVisibilityOuterInnerVisibilityInner.kt) | ||
| # to distinguish visibility combinations; the top-level class name stays short on purpose. | ||
| [tools/noopfactory/src/test/resources/**/*.kt] | ||
| ktlint_standard_filename = disabled No newline at end of file |
Member
There was a problem hiding this comment.
Suggested change
| ktlint_standard_filename = disabled | |
| ktlint_standard_filename = disabled | |
hamorillo
approved these changes
May 26, 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.

What does this PR do?
Adds an
isPrivateOrHasPrivateEnclosing()check that walks the enclosing-classchain and skips NoOp generation when any class in the chain has private or
protected visibility, preventing the emission of uncompilable code.
Motivation
Without this guard, the NoOp generator introduced in the previous PR would
attempt to implement nested interfaces that are not accessible from outside the
enclosing type, causing compilation errors.
Additional Notes
Extends the test matrix with all 12 outer × inner visibility combinations:
public/internalouter ×public/internalinner → generation expected;public/internalouter ×private/protectedinner → generation skipped;privateouter × any inner visibility → generation skipped.Stacked on "Add NoOp generation support for nested interfaces".
Review checklist (to be filled by reviewers)