Replaced ReceiverValue.NO_RECEIVER to null.

This commit is contained in:
Stanislav Erokhin
2015-12-14 20:27:04 +03:00
parent 3692318c38
commit c725ed47f5
69 changed files with 245 additions and 314 deletions
@@ -42,7 +42,7 @@ public class ShadowedDeclarationsFilter(
private val bindingContext: BindingContext,
private val resolutionFacade: ResolutionFacade,
private val context: PsiElement,
private val explicitReceiverValue: ReceiverValue
private val explicitReceiverValue: ReceiverValue?
) {
companion object {
fun create(
@@ -64,7 +64,7 @@ public class ShadowedDeclarationsFilter(
val explicitReceiverValue = receiverExpression?.let {
val type = bindingContext.getType(it) ?: return null
ExpressionReceiver.create(it, type, bindingContext)
} ?: ReceiverValue.NO_RECEIVER
}
return ShadowedDeclarationsFilter(bindingContext, resolutionFacade, context, explicitReceiverValue)
}
}
@@ -183,7 +183,7 @@ public class ShadowedDeclarationsFilter(
override fun getTypeArgumentList() = null
override fun getDispatchReceiver() = ReceiverValue.NO_RECEIVER
override fun getDispatchReceiver() = null
override fun getCallOperationNode() = null
@@ -66,8 +66,6 @@ public fun <TCallable : CallableDescriptor> TCallable.substituteExtensionIfCalla
dataFlowInfo: DataFlowInfo,
containingDeclarationOrModule: DeclarationDescriptor
): Collection<TCallable> {
if (!receiver.exists()) return listOf()
var types = SmartCastManager().getSmartCastVariants(receiver, bindingContext, containingDeclarationOrModule, dataFlowInfo)
return substituteExtensionIfCallable(types, callType)
}
@@ -101,7 +99,7 @@ public fun <TCallable : CallableDescriptor> TCallable.substituteExtensionIfCalla
}
}
public fun ReceiverValue.getThisReceiverOwner(bindingContext: BindingContext): DeclarationDescriptor? {
public fun ReceiverValue?.getThisReceiverOwner(bindingContext: BindingContext): DeclarationDescriptor? {
return when (this) {
is ExpressionReceiver -> {
val thisRef = (KtPsiUtil.deparenthesize(this.expression) as? KtThisExpression)?.getInstanceReference() ?: return null