Files
kotlin-fork/compiler/testData/diagnostics/tests/smartCasts/lambdaDeclaresAndModifiesWithDirectEq.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

20 lines
443 B
Kotlin
Vendored

// !DIAGNOSTICS: -UNUSED_PARAMETER
fun foo(arg: Int?) = run {
var x = arg
if (x == null) return@run
<!DEBUG_INFO_SMARTCAST!>x<!>.hashCode()
}
class My {
fun foo(arg: Int?) = run {
var x = arg
if (x == null) return@run
<!DEBUG_INFO_SMARTCAST!>x<!>.hashCode()
}
fun Int?.bar() = run {
var x = this
if (x == null) return@run
<!DEBUG_INFO_SMARTCAST!>x<!>.hashCode()
}
}