[FIR] Unwrap error expressions when detecting USAGE_IS_NOT_INLINABLE

Otherwise, false positive USAGE_IS_NOT_INLINABLE may be detected

^KT-65316: Fixed
This commit is contained in:
vladislav.grechko
2024-01-26 15:03:13 +01:00
committed by Space Team
parent ed246d372b
commit cd5b38b958
9 changed files with 112 additions and 4 deletions
@@ -101,6 +101,9 @@ fun <T : FirStatement> FirBlock.replaceFirstStatement(factory: (T) -> FirStateme
return existing
}
fun FirExpression.unwrapErrorExpression(): FirExpression? =
if (this is FirErrorExpression) expression?.run { unwrapErrorExpression() } else this
fun FirExpression.unwrapArgument(): FirExpression = (this as? FirWrappedArgumentExpression)?.expression ?: this
fun FirExpression.unwrapAndFlattenArgument(flattenArrays: Boolean): List<FirExpression> = buildList { unwrapAndFlattenArgumentTo(this, flattenArrays) }