"Replace 'if' with elvis operator": Don't suggest on nullable type check #KT-25886 Fixed
This commit is contained in:
committed by
Mikhail Glukhikh
parent
1a31ce769c
commit
c6db26ba91
@@ -121,6 +121,7 @@ class FoldInitializerAndIfToElvisIntention : SelfTargetingRangeIntention<KtIfExp
|
||||
}
|
||||
is KtIsExpression -> {
|
||||
if (!operationExpression.isNegated) return null
|
||||
if (operationExpression.typeReference?.typeElement is KtNullableType) return null
|
||||
operationExpression.leftHandSide
|
||||
}
|
||||
else -> return null
|
||||
|
||||
Reference in New Issue
Block a user