6735cc8937
#KT-36055 Fixed
60 lines
857 B
Kotlin
Vendored
60 lines
857 B
Kotlin
Vendored
// !LANGUAGE: +CapturedInClosureSmartCasts
|
|
|
|
fun run(f: () -> Unit) = f()
|
|
|
|
fun foo(s: String?) {
|
|
var x: String? = null
|
|
if (s != null) {
|
|
x = s
|
|
}
|
|
if (x != null) {
|
|
run {
|
|
x.hashCode()
|
|
}
|
|
}
|
|
}
|
|
|
|
fun bar(s: String?) {
|
|
var x = s
|
|
if (x != null) {
|
|
run {
|
|
x.hashCode()
|
|
}
|
|
}
|
|
}
|
|
|
|
fun baz(s: String?) {
|
|
var x = s
|
|
if (x != null) {
|
|
run {
|
|
x.hashCode()
|
|
}
|
|
run {
|
|
x.hashCode()
|
|
x = null
|
|
}
|
|
}
|
|
}
|
|
|
|
fun gaz(s: String?) {
|
|
var x = s
|
|
if (x != null) {
|
|
run {
|
|
x.hashCode()
|
|
x = null
|
|
}
|
|
run {
|
|
x.hashCode()
|
|
}
|
|
}
|
|
}
|
|
|
|
fun gav(s: String?) {
|
|
var x = s
|
|
if (x != null) {
|
|
run {
|
|
x.hashCode()
|
|
}
|
|
x = null
|
|
}
|
|
} |