Rename: ThisReceiver ---> ImplicitReceiver
This commit is contained in:
@@ -28,7 +28,7 @@ import org.jetbrains.kotlin.resolve.calls.smartcasts.SmartCastManager
|
||||
import org.jetbrains.kotlin.resolve.scopes.LexicalScope
|
||||
import org.jetbrains.kotlin.resolve.scopes.receivers.ExpressionReceiver
|
||||
import org.jetbrains.kotlin.resolve.scopes.receivers.ReceiverValue
|
||||
import org.jetbrains.kotlin.resolve.scopes.receivers.ThisReceiver
|
||||
import org.jetbrains.kotlin.resolve.scopes.receivers.ImplicitReceiver
|
||||
import org.jetbrains.kotlin.types.KotlinType
|
||||
import org.jetbrains.kotlin.types.typeUtil.TypeNullability
|
||||
import org.jetbrains.kotlin.types.typeUtil.makeNotNullable
|
||||
@@ -109,7 +109,7 @@ public fun ReceiverValue.getThisReceiverOwner(bindingContext: BindingContext): D
|
||||
bindingContext[BindingContext.REFERENCE_TARGET, thisRef]
|
||||
}
|
||||
|
||||
is ThisReceiver -> this.declarationDescriptor
|
||||
is ImplicitReceiver -> this.declarationDescriptor
|
||||
|
||||
else -> null
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ import org.jetbrains.kotlin.resolve.calls.callUtil.getCalleeExpressionIfAny
|
||||
import org.jetbrains.kotlin.resolve.calls.callUtil.getResolvedCall
|
||||
import org.jetbrains.kotlin.resolve.calls.tasks.ExplicitReceiverKind
|
||||
import org.jetbrains.kotlin.resolve.lazy.BodyResolveMode
|
||||
import org.jetbrains.kotlin.resolve.scopes.receivers.ThisReceiver
|
||||
import org.jetbrains.kotlin.resolve.scopes.receivers.ImplicitReceiver
|
||||
import org.jetbrains.kotlin.resolve.scopes.utils.findClassifier
|
||||
import org.jetbrains.kotlin.resolve.scopes.utils.findPackage
|
||||
import java.util.*
|
||||
@@ -358,7 +358,7 @@ public class ShortenReferences(val options: (KtElement) -> Options = { Options.D
|
||||
ExplicitReceiverKind.BOTH_RECEIVERS, ExplicitReceiverKind.EXTENSION_RECEIVER -> newCall.getExtensionReceiver()
|
||||
ExplicitReceiverKind.DISPATCH_RECEIVER -> newCall.getDispatchReceiver()
|
||||
else -> return false
|
||||
} as? ThisReceiver ?: return false
|
||||
} as? ImplicitReceiver ?: return false
|
||||
|
||||
val thisTarget = receiver.getInstanceReference().targets(bindingContext).singleOrNull()
|
||||
if (newReceiver.declarationDescriptor.asString() != thisTarget?.asString()) return false
|
||||
|
||||
+2
-2
@@ -17,7 +17,7 @@
|
||||
package org.jetbrains.kotlin.idea.completion
|
||||
|
||||
import org.jetbrains.kotlin.resolve.calls.smartcasts.DataFlowValue
|
||||
import org.jetbrains.kotlin.resolve.scopes.receivers.ThisReceiver
|
||||
import org.jetbrains.kotlin.resolve.scopes.receivers.ImplicitReceiver
|
||||
import org.jetbrains.kotlin.psi.KtExpression
|
||||
import org.jetbrains.kotlin.descriptors.VariableDescriptor
|
||||
import org.jetbrains.kotlin.descriptors.PackageViewDescriptor
|
||||
@@ -29,7 +29,7 @@ fun renderDataFlowValue(value: DataFlowValue): String? {
|
||||
fun renderId(id: Any?): String? {
|
||||
return when (id) {
|
||||
is KtExpression -> id.getText()
|
||||
is ThisReceiver -> "this@${id.declarationDescriptor.getName()}"
|
||||
is ImplicitReceiver -> "this@${id.declarationDescriptor.getName()}"
|
||||
is VariableDescriptor -> id.getName().asString()
|
||||
is PackageViewDescriptor -> id.fqName.asString()
|
||||
is com.intellij.openapi.util.Pair<*, *> -> renderId(id.first) + "." + renderId(id.second)
|
||||
|
||||
+4
-4
@@ -34,7 +34,7 @@ import org.jetbrains.kotlin.resolve.calls.smartcasts.DataFlowValue
|
||||
import org.jetbrains.kotlin.resolve.calls.smartcasts.DataFlowValueFactory
|
||||
import org.jetbrains.kotlin.resolve.calls.smartcasts.Nullability
|
||||
import org.jetbrains.kotlin.resolve.scopes.LexicalScope
|
||||
import org.jetbrains.kotlin.resolve.scopes.receivers.ThisReceiver
|
||||
import org.jetbrains.kotlin.resolve.scopes.receivers.ImplicitReceiver
|
||||
import org.jetbrains.kotlin.types.KotlinType
|
||||
import org.jetbrains.kotlin.types.typeUtil.isSubtypeOf
|
||||
import org.jetbrains.kotlin.types.typeUtil.makeNotNullable
|
||||
@@ -61,7 +61,7 @@ class SmartCastCalculator(
|
||||
|
||||
fun types(thisReceiverParameter: ReceiverParameterDescriptor): Collection<KotlinType> {
|
||||
val type = thisReceiverParameter.type
|
||||
val thisReceiver = thisReceiverParameter.value as? ThisReceiver ?: return listOf(type)
|
||||
val thisReceiver = thisReceiverParameter.value as? ImplicitReceiver ?: return listOf(type)
|
||||
return entityType(thisReceiver, type)
|
||||
}
|
||||
|
||||
@@ -97,12 +97,12 @@ class SmartCastCalculator(
|
||||
dataFlowValueToEntity = fun (value: DataFlowValue): Any? {
|
||||
val id = value.id
|
||||
when(id) {
|
||||
is VariableDescriptor, is ThisReceiver -> return id
|
||||
is VariableDescriptor, is ImplicitReceiver -> return id
|
||||
|
||||
is Pair<*, *> -> {
|
||||
val first = id.first
|
||||
val second = id.second
|
||||
if (first !is ThisReceiver || second !is VariableDescriptor) return null
|
||||
if (first !is ImplicitReceiver || second !is VariableDescriptor) return null
|
||||
if (resolutionScope?.findNearestReceiverForVariable(second)?.value != first) return null
|
||||
return second
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ import org.jetbrains.kotlin.resolve.calls.context.ContextDependency
|
||||
import org.jetbrains.kotlin.resolve.calls.model.ResolvedCall
|
||||
import org.jetbrains.kotlin.resolve.calls.results.ResolutionStatus
|
||||
import org.jetbrains.kotlin.resolve.scopes.LexicalScope
|
||||
import org.jetbrains.kotlin.resolve.scopes.receivers.ThisReceiver
|
||||
import org.jetbrains.kotlin.resolve.scopes.receivers.ImplicitReceiver
|
||||
import org.jetbrains.kotlin.types.KotlinType
|
||||
import org.jetbrains.kotlin.types.TypeUtils
|
||||
import org.jetbrains.kotlin.types.checker.KotlinTypeChecker
|
||||
@@ -88,7 +88,7 @@ public fun Call.mapArgumentsToParameters(targetDescriptor: CallableDescriptor):
|
||||
return map
|
||||
}
|
||||
|
||||
public fun ThisReceiver.asExpression(resolutionScope: LexicalScope, psiFactory: KtPsiFactory): KtExpression? {
|
||||
public fun ImplicitReceiver.asExpression(resolutionScope: LexicalScope, psiFactory: KtPsiFactory): KtExpression? {
|
||||
val expressionFactory = resolutionScope.getImplicitReceiversWithInstanceToExpression()
|
||||
.entrySet()
|
||||
.firstOrNull { it.key.getContainingDeclaration() == this.declarationDescriptor }
|
||||
|
||||
@@ -35,7 +35,7 @@ import org.jetbrains.kotlin.resolve.calls.callUtil.getResolvedCall
|
||||
import org.jetbrains.kotlin.resolve.scopes.receivers.ExpressionReceiver
|
||||
import org.jetbrains.kotlin.resolve.scopes.receivers.ExtensionReceiver
|
||||
import org.jetbrains.kotlin.resolve.scopes.receivers.ReceiverValue
|
||||
import org.jetbrains.kotlin.resolve.scopes.receivers.ThisReceiver
|
||||
import org.jetbrains.kotlin.resolve.scopes.receivers.ImplicitReceiver
|
||||
import kotlin.properties.Delegates
|
||||
|
||||
public class UnusedReceiverParameterInspection : AbstractKotlinInspection() {
|
||||
|
||||
+2
-2
@@ -44,7 +44,7 @@ import org.jetbrains.kotlin.resolve.calls.callUtil.getResolvedCall
|
||||
import org.jetbrains.kotlin.resolve.calls.model.*
|
||||
import org.jetbrains.kotlin.resolve.descriptorUtil.isExtension
|
||||
import org.jetbrains.kotlin.resolve.lazy.BodyResolveMode
|
||||
import org.jetbrains.kotlin.resolve.scopes.receivers.ThisReceiver
|
||||
import org.jetbrains.kotlin.resolve.scopes.receivers.ImplicitReceiver
|
||||
import org.jetbrains.kotlin.resolve.scopes.utils.findLocalVariable
|
||||
import org.jetbrains.kotlin.types.ErrorUtils
|
||||
import org.jetbrains.kotlin.types.KotlinType
|
||||
@@ -109,7 +109,7 @@ private fun performCallReplacement(
|
||||
if (receiver == null) {
|
||||
val receiverValue = if (descriptor.isExtension) resolvedCall.extensionReceiver else resolvedCall.dispatchReceiver
|
||||
val resolutionScope = elementToBeReplaced.getResolutionScope(bindingContext, elementToBeReplaced.getResolutionFacade())
|
||||
if (receiverValue is ThisReceiver) {
|
||||
if (receiverValue is ImplicitReceiver) {
|
||||
receiver = receiverValue.asExpression(resolutionScope, psiFactory)
|
||||
receiverType = receiverValue.type
|
||||
}
|
||||
|
||||
+2
-2
@@ -44,7 +44,7 @@ import org.jetbrains.kotlin.resolve.descriptorUtil.module
|
||||
import org.jetbrains.kotlin.resolve.lazy.FileScopeProvider
|
||||
import org.jetbrains.kotlin.resolve.lazy.descriptors.ClassResolutionScopesSupport
|
||||
import org.jetbrains.kotlin.resolve.scopes.*
|
||||
import org.jetbrains.kotlin.resolve.scopes.receivers.ThisReceiver
|
||||
import org.jetbrains.kotlin.resolve.scopes.receivers.ImplicitReceiver
|
||||
import org.jetbrains.kotlin.resolve.scopes.utils.chainImportingScopes
|
||||
import org.jetbrains.kotlin.resolve.scopes.utils.memberScopeAsImportingScope
|
||||
import org.jetbrains.kotlin.storage.LockBasedStorageManager
|
||||
@@ -140,7 +140,7 @@ object ReplaceWithAnnotationAnalyzer {
|
||||
resolvedCall.extensionReceiver
|
||||
else
|
||||
resolvedCall.dispatchReceiver
|
||||
if (receiver is ThisReceiver) {
|
||||
if (receiver is ImplicitReceiver) {
|
||||
val receiverExpression = receiver.asExpression(scope, psiFactory)
|
||||
if (receiverExpression != null) {
|
||||
receiversToAdd.add(expression to receiverExpression)
|
||||
|
||||
+6
-6
@@ -75,7 +75,7 @@ import org.jetbrains.kotlin.resolve.DescriptorToSourceUtils
|
||||
import org.jetbrains.kotlin.resolve.calls.callUtil.getResolvedCall
|
||||
import org.jetbrains.kotlin.resolve.calls.tasks.ExplicitReceiverKind
|
||||
import org.jetbrains.kotlin.resolve.lazy.BodyResolveMode
|
||||
import org.jetbrains.kotlin.resolve.scopes.receivers.ThisReceiver
|
||||
import org.jetbrains.kotlin.resolve.scopes.receivers.ImplicitReceiver
|
||||
import org.jetbrains.kotlin.resolve.source.getPsi
|
||||
import org.jetbrains.kotlin.utils.addToStdlib.firstIsInstanceOrNull
|
||||
import java.util.*
|
||||
@@ -186,11 +186,11 @@ class KotlinChangeSignatureUsageProcessor : ChangeSignatureUsageProcessor {
|
||||
val callElement = resolvedCall.call.callElement
|
||||
|
||||
var receiver = resolvedCall.extensionReceiver
|
||||
if (receiver !is ThisReceiver) {
|
||||
if (receiver !is ImplicitReceiver) {
|
||||
receiver = resolvedCall.dispatchReceiver
|
||||
}
|
||||
|
||||
if (receiver is ThisReceiver) {
|
||||
if (receiver is ImplicitReceiver) {
|
||||
result.add(KotlinImplicitThisUsage(callElement, receiver.declarationDescriptor))
|
||||
}
|
||||
else if (!receiver.exists()) {
|
||||
@@ -349,8 +349,8 @@ class KotlinChangeSignatureUsageProcessor : ChangeSignatureUsageProcessor {
|
||||
|
||||
private fun processImplicitThis(
|
||||
callElement: KtElement,
|
||||
receiverValue: ThisReceiver) {
|
||||
val targetDescriptor = receiverValue.declarationDescriptor
|
||||
implicitReceiver: ImplicitReceiver) {
|
||||
val targetDescriptor = implicitReceiver.declarationDescriptor
|
||||
if (compareDescriptors(callElement.project, targetDescriptor, callableDescriptor)) {
|
||||
assert(originalReceiverInfo != null) { "No original receiver info provided: " + functionUsageInfo.declaration.text }
|
||||
result.add(KotlinImplicitThisToParameterUsage(callElement, originalReceiverInfo!!, functionUsageInfo))
|
||||
@@ -373,7 +373,7 @@ class KotlinChangeSignatureUsageProcessor : ChangeSignatureUsageProcessor {
|
||||
if (!receiverValue.exists()) {
|
||||
receiverValue = resolvedCall.dispatchReceiver
|
||||
}
|
||||
if (receiverValue is ThisReceiver) {
|
||||
if (receiverValue is ImplicitReceiver) {
|
||||
processImplicitThis(resolvedCall.call.callElement, receiverValue)
|
||||
}
|
||||
|
||||
|
||||
+4
-4
@@ -32,7 +32,7 @@ import org.jetbrains.kotlin.resolve.BindingContext
|
||||
import org.jetbrains.kotlin.resolve.DescriptorToSourceUtils
|
||||
import org.jetbrains.kotlin.resolve.calls.callUtil.getResolvedCall
|
||||
import org.jetbrains.kotlin.resolve.lazy.BodyResolveMode
|
||||
import org.jetbrains.kotlin.resolve.scopes.receivers.ThisReceiver
|
||||
import org.jetbrains.kotlin.resolve.scopes.receivers.ImplicitReceiver
|
||||
import org.jetbrains.kotlin.types.KotlinType
|
||||
import java.util.*
|
||||
|
||||
@@ -81,7 +81,7 @@ public class KotlinParameterInfo @JvmOverloads constructor (
|
||||
return null
|
||||
}
|
||||
|
||||
private fun selfReceiverOrNull(receiver: ThisReceiver?): DeclarationDescriptor? {
|
||||
private fun selfReceiverOrNull(receiver: ImplicitReceiver?): DeclarationDescriptor? {
|
||||
return selfReceiverOrNull(receiver?.declarationDescriptor)
|
||||
}
|
||||
|
||||
@@ -104,8 +104,8 @@ public class KotlinParameterInfo @JvmOverloads constructor (
|
||||
return if (selfReceiverOrNull(it.getContainingDeclaration()) != null) it else null
|
||||
}
|
||||
|
||||
selfReceiverOrNull(resolvedCall.getExtensionReceiver() as? ThisReceiver)?.let { return it }
|
||||
selfReceiverOrNull(resolvedCall.getDispatchReceiver() as? ThisReceiver)?.let { return it }
|
||||
selfReceiverOrNull(resolvedCall.getExtensionReceiver() as? ImplicitReceiver)?.let { return it }
|
||||
selfReceiverOrNull(resolvedCall.getDispatchReceiver() as? ImplicitReceiver)?.let { return it }
|
||||
|
||||
return null
|
||||
}
|
||||
|
||||
+2
-2
@@ -47,7 +47,7 @@ import org.jetbrains.kotlin.resolve.lazy.BodyResolveMode
|
||||
import org.jetbrains.kotlin.resolve.scopes.receivers.ExpressionReceiver
|
||||
import org.jetbrains.kotlin.resolve.scopes.receivers.ExtensionReceiver
|
||||
import org.jetbrains.kotlin.resolve.scopes.receivers.ReceiverValue
|
||||
import org.jetbrains.kotlin.resolve.scopes.receivers.ThisReceiver
|
||||
import org.jetbrains.kotlin.resolve.scopes.receivers.ImplicitReceiver
|
||||
import org.jetbrains.kotlin.types.checker.KotlinTypeChecker
|
||||
import org.jetbrains.kotlin.types.expressions.OperatorConventions
|
||||
import org.jetbrains.kotlin.utils.sure
|
||||
@@ -503,7 +503,7 @@ class KotlinFunctionCallUsage(
|
||||
private fun getReceiverExpression(receiver: ReceiverValue, psiFactory: KtPsiFactory): KtExpression? {
|
||||
return when (receiver) {
|
||||
is ExpressionReceiver -> receiver.expression
|
||||
is ThisReceiver -> {
|
||||
is ImplicitReceiver -> {
|
||||
val descriptor = receiver.declarationDescriptor
|
||||
val thisText = if (descriptor is ClassDescriptor) "this@" + descriptor.name.asString() else "this"
|
||||
psiFactory.createExpression(thisText)
|
||||
|
||||
+3
-3
@@ -44,7 +44,7 @@ import org.jetbrains.kotlin.resolve.calls.resolvedCallUtil.getImplicitReceiverVa
|
||||
import org.jetbrains.kotlin.resolve.calls.smartcasts.DataFlowValueFactory
|
||||
import org.jetbrains.kotlin.resolve.calls.tasks.isSynthesizedInvoke
|
||||
import org.jetbrains.kotlin.resolve.descriptorUtil.isExtension
|
||||
import org.jetbrains.kotlin.resolve.scopes.receivers.ThisReceiver
|
||||
import org.jetbrains.kotlin.resolve.scopes.receivers.ImplicitReceiver
|
||||
import org.jetbrains.kotlin.synthetic.SyntheticJavaPropertyDescriptor
|
||||
import org.jetbrains.kotlin.types.KotlinType
|
||||
import java.util.*
|
||||
@@ -177,7 +177,7 @@ data class ExtractionData(
|
||||
fun getPossibleTypes(expression: KtExpression, resolvedCall: ResolvedCall<*>?, context: BindingContext): Set<KotlinType> {
|
||||
val typeInfo = context[BindingContext.EXPRESSION_TYPE_INFO, expression] ?: return emptySet()
|
||||
|
||||
(resolvedCall?.getImplicitReceiverValue() as? ThisReceiver)?.let {
|
||||
(resolvedCall?.getImplicitReceiverValue() as? ImplicitReceiver)?.let {
|
||||
return typeInfo.dataFlowInfo.getPossibleTypes(DataFlowValueFactory.createDataFlowValueForStableReceiver(it))
|
||||
}
|
||||
|
||||
@@ -210,7 +210,7 @@ data class ExtractionData(
|
||||
smartCast = originalContext[BindingContext.SMARTCAST, smartCastTarget]
|
||||
possibleTypes = getPossibleTypes(smartCastTarget, originalResolveResult.resolvedCall, originalContext)
|
||||
val receiverDescriptor =
|
||||
(originalResolveResult.resolvedCall?.getDispatchReceiver() as? ThisReceiver)?.declarationDescriptor
|
||||
(originalResolveResult.resolvedCall?.getDispatchReceiver() as? ImplicitReceiver)?.declarationDescriptor
|
||||
if (smartCast == null
|
||||
&& !DescriptorUtils.isCompanionObject(receiverDescriptor)
|
||||
&& qualifiedExpression.getReceiverExpression() !is KtSuperExpression) continue
|
||||
|
||||
+3
-3
@@ -43,7 +43,7 @@ import org.jetbrains.kotlin.resolve.descriptorUtil.getImportableDescriptor
|
||||
import org.jetbrains.kotlin.resolve.scopes.LexicalScope
|
||||
import org.jetbrains.kotlin.resolve.scopes.receivers.ExpressionReceiver
|
||||
import org.jetbrains.kotlin.resolve.scopes.receivers.ReceiverValue
|
||||
import org.jetbrains.kotlin.resolve.scopes.receivers.ThisReceiver
|
||||
import org.jetbrains.kotlin.resolve.scopes.receivers.ImplicitReceiver
|
||||
import org.jetbrains.kotlin.resolve.scopes.utils.findFunction
|
||||
import org.jetbrains.kotlin.types.CommonSupertypes
|
||||
import org.jetbrains.kotlin.types.KotlinType
|
||||
@@ -125,7 +125,7 @@ private fun ExtractionData.extractReceiver(
|
||||
) {
|
||||
val (originalRef, originalDeclaration, originalDescriptor, resolvedCall) = refInfo.resolveResult
|
||||
|
||||
val thisDescriptor = (receiverToExtract as? ThisReceiver)?.declarationDescriptor
|
||||
val thisDescriptor = (receiverToExtract as? ImplicitReceiver)?.declarationDescriptor
|
||||
val hasThisReceiver = thisDescriptor != null
|
||||
val thisExpr = refInfo.refExpr.parent as? KtThisExpression
|
||||
|
||||
@@ -277,7 +277,7 @@ private fun suggestParameterType(
|
||||
(bindingContext[BindingContext.REFERENCE_TARGET, it] as? CallableDescriptor)?.returnType
|
||||
}
|
||||
?: if (receiverToExtract.exists()) receiverToExtract.type else null
|
||||
receiverToExtract is ThisReceiver -> {
|
||||
receiverToExtract is ImplicitReceiver -> {
|
||||
val calleeExpression = resolvedCall!!.call.calleeExpression
|
||||
val typeByDataFlowInfo = if (useSmartCastsIfPossible) {
|
||||
bindingContext[BindingContext.EXPRESSION_TYPE_INFO, calleeExpression]?.dataFlowInfo?.let { dataFlowInfo ->
|
||||
|
||||
+3
-3
@@ -58,7 +58,7 @@ import org.jetbrains.kotlin.psi.*
|
||||
import org.jetbrains.kotlin.psi.psiUtil.*
|
||||
import org.jetbrains.kotlin.resolve.BindingContext
|
||||
import org.jetbrains.kotlin.resolve.calls.callUtil.getResolvedCall
|
||||
import org.jetbrains.kotlin.resolve.scopes.receivers.ThisReceiver
|
||||
import org.jetbrains.kotlin.resolve.scopes.receivers.ImplicitReceiver
|
||||
import org.jetbrains.kotlin.types.typeUtil.isNothing
|
||||
import org.jetbrains.kotlin.types.typeUtil.isUnit
|
||||
import org.jetbrains.kotlin.types.typeUtil.supertypes
|
||||
@@ -394,8 +394,8 @@ private fun findInternalUsagesOfParametersAndReceiver(
|
||||
val bindingContext = element.analyze()
|
||||
val resolvedCall = element.getResolvedCall(bindingContext) ?: return
|
||||
|
||||
if ((resolvedCall.getExtensionReceiver() as? ThisReceiver)?.declarationDescriptor == targetDescriptor ||
|
||||
(resolvedCall.getDispatchReceiver() as? ThisReceiver)?.declarationDescriptor == targetDescriptor) {
|
||||
if ((resolvedCall.getExtensionReceiver() as? ImplicitReceiver)?.declarationDescriptor == targetDescriptor ||
|
||||
(resolvedCall.getDispatchReceiver() as? ImplicitReceiver)?.declarationDescriptor == targetDescriptor) {
|
||||
usages.putValue(receiverTypeRef, resolvedCall.getCall().getCallElement())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ import org.jetbrains.kotlin.resolve.calls.model.VariableAsFunctionResolvedCall
|
||||
import org.jetbrains.kotlin.resolve.calls.tasks.ExplicitReceiverKind
|
||||
import org.jetbrains.kotlin.resolve.scopes.receivers.ExpressionReceiver
|
||||
import org.jetbrains.kotlin.resolve.scopes.receivers.ReceiverValue
|
||||
import org.jetbrains.kotlin.resolve.scopes.receivers.ThisReceiver
|
||||
import org.jetbrains.kotlin.resolve.scopes.receivers.ImplicitReceiver
|
||||
import org.jetbrains.kotlin.types.ErrorUtils
|
||||
import org.jetbrains.kotlin.types.KotlinType
|
||||
import org.jetbrains.kotlin.types.TypeUtils
|
||||
@@ -133,7 +133,7 @@ public class KotlinPsiUnifier(
|
||||
rv1 is ExpressionReceiver && rv2 is ExpressionReceiver ->
|
||||
doUnify(rv1.expression, rv2.expression) == MATCHED
|
||||
|
||||
rv1 is ThisReceiver && rv2 is ThisReceiver ->
|
||||
rv1 is ImplicitReceiver && rv2 is ImplicitReceiver ->
|
||||
matchDescriptors(rv1.declarationDescriptor, rv2.declarationDescriptor)
|
||||
|
||||
else ->
|
||||
@@ -200,11 +200,11 @@ public class KotlinPsiUnifier(
|
||||
val (implicitReceiver, explicitReceiver) =
|
||||
when (explicitCall.getExplicitReceiverKind()) {
|
||||
ExplicitReceiverKind.EXTENSION_RECEIVER ->
|
||||
(implicitCall.getExtensionReceiver() as? ThisReceiver) to
|
||||
(implicitCall.getExtensionReceiver() as? ImplicitReceiver) to
|
||||
(explicitCall.getExtensionReceiver() as? ExpressionReceiver)
|
||||
|
||||
ExplicitReceiverKind.DISPATCH_RECEIVER ->
|
||||
(implicitCall.getDispatchReceiver() as? ThisReceiver) to
|
||||
(implicitCall.getDispatchReceiver() as? ImplicitReceiver) to
|
||||
(explicitCall.getDispatchReceiver() as? ExpressionReceiver)
|
||||
|
||||
else ->
|
||||
|
||||
Reference in New Issue
Block a user