Make top-level property backing field private in bytecode
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
// FULL_JDK
|
||||
package test
|
||||
|
||||
import java.lang.reflect.Modifier
|
||||
import kotlin.test.assertTrue
|
||||
|
||||
|
||||
private val prop = "O"
|
||||
|
||||
private fun test() = "K"
|
||||
|
||||
fun box(): String {
|
||||
val clazz = Class.forName("test.PrivateVisibilityKt")
|
||||
assertTrue(Modifier.isPrivate(clazz.getDeclaredMethod("test").modifiers), "Private top level function should be private")
|
||||
assertTrue(Modifier.isPrivate(clazz.getDeclaredField("prop").modifiers), "Backing field for private top level property should be private")
|
||||
|
||||
return "OK"
|
||||
}
|
||||
@@ -23,7 +23,7 @@
|
||||
@kotlin.annotation.Target @java.lang.annotation.Retention @java.lang.annotation.Target @kotlin.jvm.internal.KotlinClass Anno
|
||||
|
||||
@kotlin.jvm.internal.KotlinFileFacade DefaultTargetsKt {
|
||||
final @Anno field p2: int
|
||||
private final @Anno field p2: int
|
||||
method <clinit>(): void
|
||||
public final method getP(): int
|
||||
public final method getP2(): int
|
||||
|
||||
Reference in New Issue
Block a user