[FE] Fix exception from the 'UnusedChecker' on a destructuring

^KT-55973 Fixed
This commit is contained in:
Yan Zhulanow
2023-01-17 05:03:01 +09:00
committed by Space Team
parent 84baee1ef1
commit 9873fe84f2
6 changed files with 36 additions and 1 deletions
@@ -79,7 +79,12 @@ object UnusedChecker : AbstractFirPropertyInitializationChecker() {
variableSymbol.lazyResolveToPhase(FirResolvePhase.BODY_RESOLVE)
@OptIn(SymbolInternals::class)
val variable = variableSymbol.fir
val variableSource = variable.source.takeIf { it?.elementType != KtNodeTypes.DESTRUCTURING_DECLARATION }
val variableSource = variable.source
if (variableSource?.elementType == KtNodeTypes.DESTRUCTURING_DECLARATION) {
continue
}
when {
data == VariableStatus.UNUSED -> {
when {