Files
kotlin-fork/compiler/testData/diagnostics/tests/smartCasts/varnotnull/postfixNullableClassIncrement.kt
T
2015-09-25 19:20:20 +03:00

13 lines
264 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++
<!DEBUG_INFO_SMARTCAST!>j<!>.hashCode()
return i
}