Cleanup: apply "lift out..." inspection (+ some others)

This commit is contained in:
Mikhail Glukhikh
2017-06-28 14:30:52 +03:00
committed by Mikhail Glukhikh
parent 0c41ceea9d
commit 9c06739594
52 changed files with 294 additions and 311 deletions
@@ -259,13 +259,13 @@ fun CallTypeAndReceiver<*, *>.receiverTypesWithIndex(
is CallTypeAndReceiver.SUPER_MEMBERS -> {
val qualifier = receiver.superTypeQualifier
if (qualifier != null) {
return listOfNotNull(bindingContext.getType(receiver)).map { ReceiverType(it, 0) }
return if (qualifier != null) {
listOfNotNull(bindingContext.getType(receiver)).map { ReceiverType(it, 0) }
}
else {
val resolutionScope = contextElement.getResolutionScope(bindingContext, resolutionFacade)
val classDescriptor = resolutionScope.ownerDescriptor.parentsWithSelf.firstIsInstanceOrNull<ClassDescriptor>() ?: return emptyList()
return classDescriptor.typeConstructor.supertypesWithAny().map { ReceiverType(it, 0) }
classDescriptor.typeConstructor.supertypesWithAny().map { ReceiverType(it, 0) }
}
}