binary-compatibility-validator icon indicating copy to clipboard operation
binary-compatibility-validator copied to clipboard

Kotlin files with non-callabale Java name and only non-public members show up in the public dump

Open martinbonnin opened this issue 2 years ago • 4 comments

Kind of an edge case but something like this:

// -foo.kt

internal fun doStuff() {}

will show up in apiDump:

public final class -fooKt { }

I think since the code is not reachable from neither Java nor Kotlin, this is technically not public API?

martinbonnin avatar Jun 02 '22 13:06 martinbonnin

That's a nice catch!

It's not a public API, but it is, technically, a public ABI similar to how inline functions are -- it can be inspected/called via reflection without isAccessible = true. Anyway, that's unlikely to have any uses and it's safe to remove such signatures from public ABI

qwwdfsad avatar Jun 02 '22 15:06 qwwdfsad

Thinking about it a bit more, it's definitely not part of ABI, because reflection is not part of it. And inline functions are because they can be invoked directly from Java (without inlining tho)

qwwdfsad avatar Aug 11 '22 12:08 qwwdfsad

Not sure if this can be considered part of the same issue or would be separate, the same also happens if you have a file that only contains members that are marked with nonPublicMarkers

gabrielittner avatar Dec 09 '22 09:12 gabrielittner

Looks like this is fixed now? We have a bunch of false positives like this being removed when upgrading to 0.15.0-beta.2 (example here)

martinbonnin avatar Apr 22 '24 11:04 martinbonnin