Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "[Xamarin.Android.Tools.Bytecode] hide Kotlin internal nested types (#827)" #855

Merged
merged 1 commit into from
Jul 2, 2021

Conversation

jpobst
Copy link
Contributor

@jpobst jpobst commented Jul 2, 2021

This reverts commit 4ef5081.

Fixes #854

Context: #827
Context: #826

As noted in the PR #827, there is some "weirdness" with what appears in the InnerClasses collection. It turns out this is due to a misunderstanding of what the InnerClasses collection contains.

Per the docs:

If a class has members that are classes or interfaces, its constant_pool table (and hence its InnerClasses attribute) 
must refer to each such member, even if that member is not otherwise mentioned by the class. **These rules 
imply that a nested class or interface member will have InnerClasses information for each enclosing class and 
for each immediate member.**

That is, a PagedList$Config$Builder$Companion class lists its grandparent type PagedList$Config and parent type PagedList$Config$Builder as InnerClasses.

The change made in PR #827 loops through InnerClasses, marking them as internal, assuming they are all nested types. This is causing us to hide parent types when we are trying to hide child types.

This will require more investigation and the deadline for 16.11 is ~now, so we're just going to revert the original commit for now.

@jonpryor jonpryor merged commit 4a02bc3 into main Jul 2, 2021
@jonpryor jonpryor deleted the revert-827 branch July 2, 2021 16:53
jonpryor pushed a commit that referenced this pull request Jul 2, 2021
)

Revert commit 4ef5081.

Fixes: #854

Context: 4ef5081
Context: #826

[As noted][0] in [PR #827][1], there is some "weirdness" with what
appears in the [`InnerClasses` collection][2].  It turns out this is
due to a misunderstanding of what the `InnerClasses` collection
contains.

As per the [docs][2]]:

> If a class has members that are classes or interfaces, its
> `constant_pool` table (and hence its `InnerClasses` attribute) must
> refer to each such member, even if that member is not otherwise
> mentioned by the class.
> **These rules imply that a nested class or interface member will
> have `InnerClasses` information for each enclosing class and for
> each immediate member.**

(Emphasis added.)  That is, the `PagedList$Config$Builder$Companion`
class lists *both* its immediate containing type
`PagedList$Config$Builder` and the "parent-parent" containing type
`PagedList$Config` within `InnerClasses`.

The change made in commit 4ef5081 loops through `InnerClasses`,
marking them as `internal`, assuming they are all nested types.
This is causing us to hide *declaring* types when we are trying to
hide *nested* types.

This will require more investigation and the deadline for 16.11 is
~now, so we're just going to revert the original commit.

[0]: #827 (comment)
[1]: #827
[2]: https://docs.oracle.com/javase/specs/jvms/se7/html/jvms-4.html#jvms-4.7.6
@jpobst jpobst added this to the 11.4 (16.11 / 8.11) milestone Jul 6, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Apr 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Regression hiding nested internal Kotlin types
2 participants