mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-12 00:21:32 +00:00
18 lines
507 B
Kotlin
Vendored
18 lines
507 B
Kotlin
Vendored
// 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"
|
|
} |