9dd8eda1c9
Library methods such as 'listOf' are resolved to have the package fragments as their parents, but JVM expects their containing file classes as parents. This fix generates those file classes and uses them as parent replacements for such library methods.
23 lines
468 B
Kotlin
Vendored
23 lines
468 B
Kotlin
Vendored
// !LANGUAGE: +StrictJavaNullabilityAssertions
|
|
// TARGET_BACKEND: JVM
|
|
// WITH_RUNTIME
|
|
|
|
// FILE: box.kt
|
|
import kotlin.test.*
|
|
|
|
fun box(): String {
|
|
val actualValues = mutableListOf<Int>()
|
|
for (i in J.arrayOfMaybeNullable()) {
|
|
actualValues += i
|
|
}
|
|
assertEquals(listOf(42, null), actualValues)
|
|
return "OK"
|
|
}
|
|
|
|
// FILE: J.java
|
|
public class J {
|
|
public static Integer[] arrayOfMaybeNullable() {
|
|
return new Integer[] { 42, null };
|
|
}
|
|
}
|