mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-09 08:31:29 +00:00
15 lines
361 B
Kotlin
Vendored
15 lines
361 B
Kotlin
Vendored
// TARGET_BACKEND: JVM
|
|
// FULL_JDK
|
|
// WITH_RUNTIME
|
|
|
|
import java.lang.reflect.Modifier
|
|
|
|
abstract class A : Collection<String> {
|
|
protected fun <T> foo(x: Array<T>): Array<T> = x
|
|
}
|
|
|
|
fun box(): String {
|
|
val method = A::class.java.declaredMethods.single { it.name == "foo" }
|
|
return if (Modifier.isProtected(method.modifiers)) "OK" else "Fail: $method"
|
|
}
|