Files
kotlin-fork/compiler/testData/codegen/box/regressions/arrayLengthNPE.kt
T
2020-03-23 15:13:50 +03:00

14 lines
257 B
Kotlin
Vendored

// See KT-14242
var x = 1
fun box(): String {
val testArray: Array<String?>? = when (1) {
x -> null
else -> arrayOfNulls<String>(0)
}
// Must not be NPE here
val size = testArray?.size
return size?.toString() ?: "OK"
}