mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-09 08:31:29 +00:00
26 lines
547 B
Kotlin
Vendored
26 lines
547 B
Kotlin
Vendored
// IGNORE_BACKEND_FIR: JVM_IR
|
|
// TARGET_BACKEND: JVM
|
|
// WITH_RUNTIME
|
|
// FILE: test.kt
|
|
import kotlin.test.*
|
|
|
|
fun box(): String {
|
|
assertFailsWith<NullPointerException> { J.j().method() }
|
|
assertFailsWith<NullPointerException> { J.j().field }
|
|
assertFailsWith<NullPointerException> { J.j().field = 42 }
|
|
return "OK"
|
|
}
|
|
|
|
// FILE: J.java
|
|
public class J {
|
|
public Object field;
|
|
|
|
public void method() {}
|
|
|
|
public static J j() { return null; }
|
|
}
|
|
|
|
// @TestKt.class:
|
|
// 0 checkNotNullExpressionValue
|
|
// 0 checkExpressionValueIsNotNull
|