b2041e0927
There are many complications with the current design of passing data from within in-place lambdas to surrounding code. Solving these complications will involve more time to investigation than is available within the K2 release. So we are disabling passing type statement information from lambdas for the time being until more time can be devoted to a more complete solution. ^KT-60958 Fixed ^KT-63530 Fixed
13 lines
290 B
Kotlin
Vendored
13 lines
290 B
Kotlin
Vendored
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
|
fun foo(arg: Int?) {
|
|
var x = arg
|
|
if (x == null) return
|
|
run {
|
|
// Stable because `run` is in-place
|
|
x.hashCode()
|
|
x = null
|
|
}
|
|
if (x != null) x = 42
|
|
// Unsafe because of lambda
|
|
x<!UNSAFE_CALL!>.<!>hashCode()
|
|
} |