Files
kotlin-fork/compiler/testData/diagnostics/tests/smartCasts/ownerDeclaresBothModifies.kt
T
Stanislav Erokhin 298a075381 Minor. removed functions which declared in Standard.kt from diagnostic testdata.
Removed declaration for functions: TODO, run, with, apply, let.
2016-01-25 19:13:31 +03:00

13 lines
330 B
Kotlin
Vendored

// !DIAGNOSTICS: -UNUSED_PARAMETER
fun foo(arg: Int?) {
var x = arg
if (x == null) return
run {
// Unsafe because of owner modification
<!SMARTCAST_IMPOSSIBLE!>x<!>.hashCode()
x = null
}
if (x != null) x = 42
// Unsafe because of lambda
<!SMARTCAST_IMPOSSIBLE!>x<!>.hashCode()
}