diff --git a/plugins/kotlin/code-insight/inspections-k2/src/org/jetbrains/kotlin/idea/k2/codeinsight/inspections/MoveLambdaOutsideParenthesesInspection.kt b/plugins/kotlin/code-insight/inspections-k2/src/org/jetbrains/kotlin/idea/k2/codeinsight/inspections/MoveLambdaOutsideParenthesesInspection.kt index 0e931b62cc99..2038347dbf88 100644 --- a/plugins/kotlin/code-insight/inspections-k2/src/org/jetbrains/kotlin/idea/k2/codeinsight/inspections/MoveLambdaOutsideParenthesesInspection.kt +++ b/plugins/kotlin/code-insight/inspections-k2/src/org/jetbrains/kotlin/idea/k2/codeinsight/inspections/MoveLambdaOutsideParenthesesInspection.kt @@ -47,10 +47,9 @@ internal class MoveLambdaOutsideParenthesesInspection : KotlinApplicableInspecti } } - override fun isApplicableByPsi(element: KtCallExpression): Boolean = element.canMoveLambdaOutsideParentheses(skipComplexCalls = false) - context(KtAnalysisSession) - override fun prepareContext(element: KtCallExpression) { + override fun prepareContext(element: KtCallExpression): Unit? { + return if (!element.canMoveLambdaOutsideParentheses(skipComplexCalls = false)) null else Unit } override fun createQuickFix(