diff --git a/idea/src/org/jetbrains/kotlin/idea/quickfix/ImportFix.kt b/idea/src/org/jetbrains/kotlin/idea/quickfix/ImportFix.kt index eb5ba415fdf..60e0d7df4ff 100644 --- a/idea/src/org/jetbrains/kotlin/idea/quickfix/ImportFix.kt +++ b/idea/src/org/jetbrains/kotlin/idea/quickfix/ImportFix.kt @@ -506,10 +506,12 @@ internal class ImportForMismatchingArgumentsFix( val resolutionFacade = file.getResolutionFacade() val resolutionScope = elementToAnalyze.getResolutionScope(bindingContext, resolutionFacade) + val imported = resolutionScope.collectFunctions(identifier, NoLookupLocation.FROM_IDE) + fun filterFunction(descriptor: FunctionDescriptor): Boolean { if (!callTypeAndReceiver.callType.descriptorKindFilter.accepts(descriptor)) return false - if (descriptor in resolutionScope.collectFunctions(identifier, NoLookupLocation.FROM_IDE)) return false // already imported + if (descriptor.original in imported) return false // already imported // check that this function matches all arguments val resolutionScopeWithAddedImport = resolutionScope.addImportingScope(ExplicitImportsScope(listOf(descriptor)))