Files
kotlin-fork/compiler/testData/diagnostics/tests/smartCasts/varnotnull/prefixNotnullClassIncrement.fir.kt
T

13 lines
268 B
Kotlin
Vendored

// !WITH_NEW_INFERENCE
class MyClass
operator fun MyClass.inc(): MyClass { return null!! }
public fun box() {
var i : MyClass?
i = MyClass()
// Type of j should be inferred as MyClass?
var j = ++i
// j is null so call is unsafe
j.hashCode()
}