RedundantRequireNotNullCallInspection: should use BodyResolveMode.PARTIAL_WITH_CFA instead of BodyResolveMode.PARTIAL
#KT-34672 Fixed
This commit is contained in:
+1
-1
@@ -71,7 +71,7 @@ private class RemoveRequireNotNullCallFix(private val functionName: String) : Lo
|
||||
val callExpression = descriptor.psiElement.getStrictParentOfType<KtCallExpression>() ?: return
|
||||
val argument = callExpression.valueArguments.firstOrNull()?.getArgumentExpression() ?: return
|
||||
val target = callExpression.getQualifiedExpressionForSelector() ?: callExpression
|
||||
if (callExpression.isUsedAsExpression(callExpression.analyze(BodyResolveMode.PARTIAL))) {
|
||||
if (callExpression.isUsedAsExpression(callExpression.analyze(BodyResolveMode.PARTIAL_WITH_CFA))) {
|
||||
target.replace(argument)
|
||||
} else {
|
||||
target.delete()
|
||||
|
||||
-5
@@ -1,5 +0,0 @@
|
||||
Actual data differs from file content: usedAsExpression.kt.after expected:<...: Int) {
|
||||
val a =[ i]
|
||||
}> but was:<...: Int) {
|
||||
val a =[]
|
||||
}>
|
||||
-5
@@ -1,5 +0,0 @@
|
||||
Actual data differs from file content: usedAsExpression2.kt.after expected:<... Int) {
|
||||
println([i])
|
||||
}> but was:<... Int) {
|
||||
println([])
|
||||
}>
|
||||
-5
@@ -1,5 +0,0 @@
|
||||
Actual data differs from file content: usedAsExpression3.kt.after expected:<...st(i: Int) {
|
||||
"${[i]}"
|
||||
}> but was:<...st(i: Int) {
|
||||
"${[]}"
|
||||
}>
|
||||
@@ -16,9 +16,6 @@ org.jetbrains.kotlin.idea.inspections.CoroutineNonBlockingContextDetectionTest.t
|
||||
org.jetbrains.kotlin.idea.inspections.CoroutineNonBlockingContextDetectionTest.testLambdaReceiverType, KT-34659
|
||||
org.jetbrains.kotlin.idea.inspections.CoroutineNonBlockingContextDetectionTest.testNestedFunctionsInsideSuspendLambda, KT-34659
|
||||
org.jetbrains.kotlin.idea.inspections.CoroutineNonBlockingContextDetectionTest.testSimpleCoroutineScope, KT-34659
|
||||
org.jetbrains.kotlin.idea.inspections.LocalInspectionTestGenerated.RedundantRequireNotNullCall.testUsedAsExpression, KT-34672, FAIL
|
||||
org.jetbrains.kotlin.idea.inspections.LocalInspectionTestGenerated.RedundantRequireNotNullCall.testUsedAsExpression2, KT-34672, FAIL
|
||||
org.jetbrains.kotlin.idea.inspections.LocalInspectionTestGenerated.RedundantRequireNotNullCall.testUsedAsExpression3, KT-34672, FAIL
|
||||
org.jetbrains.kotlin.idea.parameterInfo.ParameterInfoTestGenerated.WithLib1.testUseJavaFromLib, KT-34542, FAIL
|
||||
org.jetbrains.kotlin.idea.parameterInfo.ParameterInfoTestGenerated.WithLib2.testUseJavaSAMFromLib, KT-34542, FAIL
|
||||
org.jetbrains.kotlin.idea.parameterInfo.ParameterInfoTestGenerated.WithLib3.testUseJavaSAMFromLib, KT-34542, FAIL
|
||||
|
||||
Reference in New Issue
Block a user