From 5dd0110a5925f223555fc34d0ddda18ee861a96a Mon Sep 17 00:00:00 2001 From: Toshiaki Kameyama Date: Thu, 13 Jun 2019 15:38:03 +0900 Subject: [PATCH] Use safe cast --- .../idea/quickfix/replaceWith/DeprecatedSymbolUsageFixBase.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/idea/src/org/jetbrains/kotlin/idea/quickfix/replaceWith/DeprecatedSymbolUsageFixBase.kt b/idea/src/org/jetbrains/kotlin/idea/quickfix/replaceWith/DeprecatedSymbolUsageFixBase.kt index 8e7086ffdf8..8fd482bf3a7 100644 --- a/idea/src/org/jetbrains/kotlin/idea/quickfix/replaceWith/DeprecatedSymbolUsageFixBase.kt +++ b/idea/src/org/jetbrains/kotlin/idea/quickfix/replaceWith/DeprecatedSymbolUsageFixBase.kt @@ -127,7 +127,7 @@ abstract class DeprecatedSymbolUsageFixBase( val receiver = classLiteral.receiverExpression ?: return this val typeParameterText = (descriptor as? CallableDescriptor)?.typeParameters?.firstOrNull()?.name?.asString() ?: return this if (receiver.text != typeParameterText) return this - val typeReference = (element.parent as KtCallExpression).typeArguments.firstOrNull()?.typeReference ?: return this + val typeReference = (element.parent as? KtCallExpression)?.typeArguments?.firstOrNull()?.typeReference ?: return this val type = element.analyze(BodyResolveMode.PARTIAL)[BindingContext.TYPE, typeReference] if (type != null && KotlinBuiltIns.isArray(type)) { receiver.replace(typeReference)