Minor. Introduce ExpressionOrImplicitThisClassReceiver.
This commit is contained in:
@@ -20,8 +20,8 @@ import kotlin.SetsKt;
|
|||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
import org.jetbrains.kotlin.resolve.DescriptorUtils;
|
import org.jetbrains.kotlin.resolve.DescriptorUtils;
|
||||||
import org.jetbrains.kotlin.resolve.scopes.receivers.ClassReceiver;
|
|
||||||
import org.jetbrains.kotlin.resolve.scopes.receivers.ReceiverValue;
|
import org.jetbrains.kotlin.resolve.scopes.receivers.ReceiverValue;
|
||||||
|
import org.jetbrains.kotlin.resolve.scopes.receivers.ExpressionOrImplicitClassReceiver;
|
||||||
import org.jetbrains.kotlin.util.ModuleVisibilityHelper;
|
import org.jetbrains.kotlin.util.ModuleVisibilityHelper;
|
||||||
import org.jetbrains.kotlin.utils.CollectionsKt;
|
import org.jetbrains.kotlin.utils.CollectionsKt;
|
||||||
|
|
||||||
@@ -76,8 +76,8 @@ public class Visibilities {
|
|||||||
if (PRIVATE.isVisible(thisObject, what, from)) {
|
if (PRIVATE.isVisible(thisObject, what, from)) {
|
||||||
DeclarationDescriptor classDescriptor = DescriptorUtils.getParentOfType(what, ClassDescriptor.class);
|
DeclarationDescriptor classDescriptor = DescriptorUtils.getParentOfType(what, ClassDescriptor.class);
|
||||||
|
|
||||||
if (classDescriptor != null && thisObject instanceof ClassReceiver) {
|
if (classDescriptor != null && thisObject instanceof ExpressionOrImplicitClassReceiver) {
|
||||||
return ((ClassReceiver) thisObject).getDeclarationDescriptor().getOriginal() == classDescriptor.getOriginal();
|
return ((ExpressionOrImplicitClassReceiver) thisObject).getClassDescriptor().getOriginal().equals(classDescriptor.getOriginal());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -18,7 +18,11 @@ package org.jetbrains.kotlin.resolve.scopes.receivers
|
|||||||
|
|
||||||
import org.jetbrains.kotlin.descriptors.ClassDescriptor
|
import org.jetbrains.kotlin.descriptors.ClassDescriptor
|
||||||
|
|
||||||
open class ClassReceiver(private val classDescriptor: ClassDescriptor) : ThisReceiver {
|
interface ExpressionOrImplicitClassReceiver : ReceiverValue {
|
||||||
|
val classDescriptor: ClassDescriptor
|
||||||
|
}
|
||||||
|
|
||||||
|
open class ClassReceiver(override val classDescriptor: ClassDescriptor) : ExpressionOrImplicitClassReceiver, ThisReceiver {
|
||||||
|
|
||||||
override fun exists() = true
|
override fun exists() = true
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user