When dumping static final fields generated for const vals declared inside a companion object, BCV ignores the companion's visibility.
Consider the following classes:
class A private constructor() {
internal companion object { const val x: Int = 0 }
}
class B private constructor() {
private companion object { const val y: Int = 0 }
}
class C private constructor() {
@PrivateApi // registered as nonPublicMarker
companion object { const val z: Int = 0 }
}
In the first two cases, properties are effectively private. In the last case, we kindly ask BCV to treat a companion object as private. However, an ABI dump for all three classes will include fields backing corresponding properties:
public final class cases/companions/A {
public static final field x I
}
public final class cases/companions/B {
public static final field y I
}
public final class cases/companions/C {
public static final field z I
}
When dumping static final fields generated for
const val
s declared inside a companion object, BCV ignores the companion's visibility.Consider the following classes:
In the first two cases, properties are effectively private. In the last case, we kindly ask BCV to treat a companion object as private. However, an ABI dump for all three classes will include fields backing corresponding properties: