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

The Companion field corresponding to an internal companion object is not part of the public API #53

Closed
garyp opened this issue May 7, 2021 · 3 comments · Fixed by #59

Comments

@garyp
Copy link

garyp commented May 7, 2021

If I have a class declared like:

package pbandk

class Foo internal constructor() {
    internal companion object {
        ...
    }
}

The API dump is incorrectly showing the Companion field as part of the public API:

public final class pbandk/Foo {
	public static final field Companion Lpbandk/Foo$Companion;
}
@zach-klippenstein
Copy link

Which version of kotlin and this tool are you using?

@garyp
Copy link
Author

garyp commented May 10, 2021

Sorry, forgot to specify that. This is with Kotlin 1.4.31 and version 0.2.4 of this plugin. I didn't see anything in the changelog of more recent versions of this plugin that would make me think it's fixed, but I can also try to reproduce with 0.5.0 if you'd like.

@zach-klippenstein
Copy link

zach-klippenstein commented May 11, 2021

I noticed something similar with Kotlin 1.5.0 and an older version of this tool (so not the exact same issue, but similar), so I wouldn't be surprised if this has been fixed too.

qwwdfsad added a commit that referenced this issue Jun 2, 2021
…e visibility of the companion class itself

Fixes #53
qwwdfsad added a commit that referenced this issue Jun 7, 2021
#59)

* Evaluate 'static final Companion' visibility in the outer class to the visibility of the companion class itself

Fixes #53
anthonymonori added a commit to anthonymonori/sequence-layout that referenced this issue Nov 18, 2021
…0.8.0

- See: Kotlin/binary-compatibility-validator#53

Signed-off-by: Antal János Monori <antal.monori@transferwise.com>
anthonymonori added a commit to anthonymonori/sequence-layout that referenced this issue Nov 23, 2021
…0.8.0

- See: Kotlin/binary-compatibility-validator#53

Signed-off-by: Antal János Monori <antal.monori@transferwise.com>
anthonymonori added a commit to transferwise/sequence-layout that referenced this issue Nov 24, 2021
* Update build and compile dependencies

- Updated to binary-compatibility-validator 0.8.0
- Updated to Gradle 7.3
- Updated to AGP 7.0.3

Signed-off-by: Antal János Monori <antal.monori@transferwise.com>

* Update API contract after a regression with Kotlin 1.5+ got fixed in 0.8.0

- See: Kotlin/binary-compatibility-validator#53

Signed-off-by: Antal János Monori <antal.monori@transferwise.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants