From 8bc7cf3d18efcb1b9da3c35c8ce74a000290bdf6 Mon Sep 17 00:00:00 2001 From: Valentin Kipyatkov Date: Thu, 27 Nov 2014 20:15:00 +0300 Subject: [PATCH] Smart completion fixed filtering of non-suitable generic inheritors --- .../jet/plugin/completion/smart/TypeInstantiationItems.kt | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/idea/src/org/jetbrains/jet/plugin/completion/smart/TypeInstantiationItems.kt b/idea/src/org/jetbrains/jet/plugin/completion/smart/TypeInstantiationItems.kt index 6b16533eb9a..29573898925 100644 --- a/idea/src/org/jetbrains/jet/plugin/completion/smart/TypeInstantiationItems.kt +++ b/idea/src/org/jetbrains/jet/plugin/completion/smart/TypeInstantiationItems.kt @@ -298,11 +298,10 @@ class TypeInstantiationItems( reconstructionResult.getResultingType() ?: continue } else { - val type = descriptor.getDefaultType() - // check if derived type matches type arguments for base - if (baseHasTypeArgs && !type.isSubtypeOf(expectedType)) continue - type + descriptor.getDefaultType() } + // check if derived type matches type arguments for base + if (baseHasTypeArgs && !resultingType.isSubtypeOf(expectedType)) continue val lookupElement = createTypeInstantiationItem(descriptor, resultingType.getArguments(), tail) ?: continue consumer(lookupElement.assignSmartCompletionPriority(SmartCompletionItemPriority.INHERITOR_INSTANTIATION))