Fix completing members for receivers shadowed by DslMarker

#KT-20396 Fixed
This commit is contained in:
Pavel V. Talanov
2018-08-07 21:48:26 +02:00
parent 0c1d25d5ac
commit b59f134f78
12 changed files with 115 additions and 54 deletions
@@ -303,15 +303,14 @@ internal class ImportFix(expression: KtSimpleNameExpression) : OrdinaryImportFix
indicesHelper.getKotlinEnumsByName(name).filterTo(result, filterByCallType)
val resolutionFacade = element.getResolutionFacade()
var actualReceiverTypes = callTypeAndReceiver
.receiverTypesWithIndex(bindingContext, element,
resolutionFacade.moduleDescriptor, resolutionFacade,
stableSmartCastsOnly = false,
withImplicitReceiversWhenExplicitPresent = true).orEmpty()
val actualReceiverTypes = callTypeAndReceiver
.receiverTypesWithIndex(
bindingContext, element,
resolutionFacade.moduleDescriptor, resolutionFacade,
stableSmartCastsOnly = false,
withImplicitReceiversWhenExplicitPresent = true
).orEmpty()
if (element.languageVersionSettings.supportsFeature(LanguageFeature.DslMarkersSupport)) {
actualReceiverTypes -= actualReceiverTypes.shadowedByDslMarkers()
}
val explicitReceiverTypes = actualReceiverTypes.filterNot { it.implicit }