From 2c94f3eaeb638297d1875fc71e32af04ff55d611 Mon Sep 17 00:00:00 2001 From: Yan Zhulanow Date: Wed, 4 Mar 2020 23:02:08 +0900 Subject: [PATCH] Minor: Fix formatting Original commit: d86b54a2f1ba3bd2efb4cb3c5dcca09fc55468e5 GitOrigin-RevId: 0445b85c1b556e363499dffa82498958cae68907 --- .../collections/UselessCallOnCollectionInspection.kt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/plugins/kotlin/idea/src/org/jetbrains/kotlin/idea/inspections/collections/UselessCallOnCollectionInspection.kt b/plugins/kotlin/idea/src/org/jetbrains/kotlin/idea/inspections/collections/UselessCallOnCollectionInspection.kt index f5bf126bd397..9087aa2e8d08 100644 --- a/plugins/kotlin/idea/src/org/jetbrains/kotlin/idea/inspections/collections/UselessCallOnCollectionInspection.kt +++ b/plugins/kotlin/idea/src/org/jetbrains/kotlin/idea/inspections/collections/UselessCallOnCollectionInspection.kt @@ -54,9 +54,10 @@ class UselessCallOnCollectionInspection : AbstractUselessCallInspection() { if (TypeUtils.isNullableType(receiverTypeArgument)) return if (calleeExpression.text != "filterNotNull") { // Also check last argument functional type to have not-null result - if (!resolvedCall.hasLastFunctionalParameterWithResult(context) { - !TypeUtils.isNullableType(it) && it.constructor !is TypeVariableTypeConstructor - }) return + val lastParameterMatches = resolvedCall.hasLastFunctionalParameterWithResult(context) { + !TypeUtils.isNullableType(it) && it.constructor !is TypeVariableTypeConstructor + } + if (!lastParameterMatches) return } }