"Remove redundant toString": fix false positive for nested nullable

So #KT-24557 Fixed
This commit is contained in:
Toshiaki Kameyama
2018-05-25 05:27:46 +03:00
committed by Mikhail Glukhikh
parent 4038d4d507
commit 8969e7a6e1
5 changed files with 34 additions and 3 deletions
@@ -82,9 +82,11 @@ class RemoveRedundantCallsOfConversionMethodsIntention : SelfTargetingRangeInten
Boolean::class.qualifiedName
} else {
resolvedCall?.candidateDescriptor?.returnType?.let {
if (it.isFlexible()) null
else if (it.isMarkedNullable && parent !is KtSafeQualifiedExpression) null
else it.getFqNameAsString()
when {
it.isFlexible() -> null
parent !is KtSafeQualifiedExpression && (this is KtSafeQualifiedExpression || it.isMarkedNullable) -> null
else -> it.getFqNameAsString()
}
}
}
}