diff --git a/idea/src/org/jetbrains/kotlin/idea/quickfix/InlineTypeParameterFix.kt b/idea/src/org/jetbrains/kotlin/idea/quickfix/InlineTypeParameterFix.kt index 942a523ed7c..03cf823b5d9 100644 --- a/idea/src/org/jetbrains/kotlin/idea/quickfix/InlineTypeParameterFix.kt +++ b/idea/src/org/jetbrains/kotlin/idea/quickfix/InlineTypeParameterFix.kt @@ -34,11 +34,11 @@ class InlineTypeParameterFix(val typeReference: KtTypeReference) : KotlinQuickFi val parameterListOwner = typeReference.getStrictParentOfType() ?: return val context = parameterListOwner.analyzeFully() val parameterDescriptor = context[BindingContext.TYPE_PARAMETER, parameter] ?: return - parameterListOwner.forEachDescendantOfType { - val typeElement = it.typeElement - val type = context[BindingContext.TYPE, it] + parameterListOwner.forEachDescendantOfType { typeReference -> + val typeElement = typeReference.typeElement + val type = context[BindingContext.TYPE, typeReference] if (typeElement != null && type != null && type.constructor.declarationDescriptor == parameterDescriptor) { - typeElement.replace(bound) + typeReference.replace(bound) } }