[K2]: Missing error and miscompilation in destructuring declaration delegation

In convertDestructingDeclaration, property delegates are mistakenly
treated as valid expressions for destructuring, but they should be
ignored.

#KT-65021 Fixed
This commit is contained in:
Anastasia.Nekrasova
2024-01-24 22:12:00 +02:00
committed by Space Team
parent b0367d9399
commit 1d817e2ace
8 changed files with 94 additions and 0 deletions
@@ -0,0 +1,6 @@
// WITH_STDLIB
fun foo() {
<!INITIALIZER_REQUIRED_FOR_DESTRUCTURING_DECLARATION!>val (a, b) by listOf(1, 2)<!>
<!INITIALIZER_REQUIRED_FOR_DESTRUCTURING_DECLARATION!>val (c, d) by lazy { listOf(3, 4) }<!>
}