Closed
Description
The following:
@Target(AnnotationTarget.PROPERTY)
annotation class HiddenProperty
public class Foo {
companion object {
@HiddenProperty
const val bar = "barValue"
}
}
Generates the following pseudo Java code:
public final class Foo {
@NotNull
public static final String bar = "barValue";
@NotNull
public static final Companion Companion = new Companion((DefaultConstructorMarker)null);
public static final class Companion {
// $FF: synthetic method
@HiddenProperty
public static void getBar$annotations() {
}
private Companion() {
}
}
}
Because the synthetic method carrying the annotations is not in the same class as the field, it is ignored and the field is marked as public API even though it shouldn't.