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

13 lines
237 B
Kotlin
Vendored

class MyClass
// Correct at compile time but wrong at run-time
operator fun MyClass?.inc(): MyClass? { return null }
public fun box() : MyClass? {
var i : MyClass?
i = MyClass()
var j = i++
j.hashCode()
return i
}