adb8e60615
Last declaration in block is resolved in DEPENDENT mode because it has influence on return type and therefore fake call for destructuring declaration wasn't completed (see `getBlockReturnedTypeWithWritableScope`) Now we resolve fake call for destructuring declaration in INDEPENDENT mode as it doesn't have effect on return type #KT-15480 Fixed
30 lines
394 B
Kotlin
Vendored
30 lines
394 B
Kotlin
Vendored
// !DIAGNOSTICS: -UNUSED_VARIABLE, -UNUSED_PARAMETER
|
|
|
|
fun test(list: A) {
|
|
if (true) {
|
|
val (c) = list
|
|
}
|
|
else {}
|
|
|
|
if (true) {
|
|
Unit
|
|
val (c) = list
|
|
}
|
|
else {}
|
|
|
|
when (1) {
|
|
1 -> {
|
|
val (c) = list
|
|
}
|
|
}
|
|
|
|
fn { it ->
|
|
val (a) = it
|
|
}
|
|
}
|
|
|
|
class A {
|
|
operator fun component1() = 1
|
|
}
|
|
|
|
fun fn(x: (A) -> Unit) {} |