[LL FIR] KTIJ-24574 Fix containing declaration finder for init blocks

- KTIJ-24574 occurred because a local destructuring declaration was
  erroneously returned as the non-local containing declaration of an
  element by `getNonLocalContainingOrThisDeclaration`. This occurred in
  `init` blocks.

KTIJ-24574 fixed
This commit is contained in:
Marco Pennekamp
2023-02-09 15:18:29 +01:00
committed by Space Team
parent 769fb835f9
commit fb43e53ca3
9 changed files with 62 additions and 14 deletions
@@ -0,0 +1,11 @@
var x: Any = 2
class Test {
init {
val (type, entityName) = when {
x is Int -> Int::class.java to "Int"
<caret>x is String -> String::class.java to "String"
else -> null to null
}
}
}