KT-30996: Use the last receiver to complete dsl methods

- change `detectReceiverTypes` return type to `List` instead of `Collection`
  - it reflects that receiver types are actually ordered
  - did not propagate signature changes to all possible places because it creates too much noise in git history
- ^KT-30996 Fixed
This commit is contained in:
Roman Golyshev
2019-09-05 11:59:55 +03:00
committed by Roman Golyshev
parent b2d2ba5811
commit b422485440
6 changed files with 37 additions and 6 deletions
@@ -249,7 +249,7 @@ fun CallTypeAndReceiver<*, *>.receiverTypes(
moduleDescriptor: ModuleDescriptor,
resolutionFacade: ResolutionFacade,
stableSmartCastsOnly: Boolean
): Collection<KotlinType>? {
): List<KotlinType>? {
return receiverTypesWithIndex(bindingContext, contextElement, moduleDescriptor, resolutionFacade, stableSmartCastsOnly)?.map { it.type }
}
@@ -260,7 +260,7 @@ fun CallTypeAndReceiver<*, *>.receiverTypesWithIndex(
resolutionFacade: ResolutionFacade,
stableSmartCastsOnly: Boolean,
withImplicitReceiversWhenExplicitPresent: Boolean = false
): Collection<ReceiverType>? {
): List<ReceiverType>? {
val languageVersionSettings = resolutionFacade.frontendService<LanguageVersionSettings>()
val receiverExpression: KtExpression?