Check function name in isGenericToArray/isNonGenericToArray

#KT-24427 Fixed
This commit is contained in:
Alexander Udalov
2018-05-24 15:16:57 +02:00
parent 92d848b6e6
commit 9c5256434c
5 changed files with 33 additions and 2 deletions
@@ -0,0 +1,14 @@
// 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"
}