Files
kotlin/compiler/testData/codegen/bytecodeText/notNullAssertions/assertionForNotNullCaptured.kt
Alexander Udalov 480313210a Use Intrinsics.checkNotNullExpressionValue to throw NPE in Java null checks
Similarly to previous commit, this method was unused since its
introduction before 1.0, so we're changing its semantics to throw NPE
and starting to use it with API version >= 1.4.

 #KT-22275 In Progress
2019-08-12 16:09:23 +02:00

14 lines
288 B
Kotlin
Vendored

// IGNORE_BACKEND: JVM_IR
// Missing IMPLICIT_NOTNULL casts
class A<T> {
fun add(element: T) {}
}
public fun <R : Any> foo(x: MutableCollection<in R>, block: java.util.AbstractList<R>) {
x.add(block.get(0))
}
// 1 checkExpressionValueIsNotNull
// 0 checkNotNullExpressionValue