Fix NPE in KtSourceElement.elementType #KT-44152 Fixed

This commit is contained in:
Mikhail Glukhikh
2022-03-10 08:40:38 +03:00
committed by Space
parent 8c7a8edb75
commit 4178c8156a
4 changed files with 33 additions and 4 deletions
+17
View File
@@ -0,0 +1,17 @@
// SKIP_JDK6
// TARGET_BACKEND: JVM_IR
// FULL_JDK
// WITH_STDLIB
// USE_PSI_CLASS_FILES_READING
// Based on incorrectToArrayDetection.kt
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"
}