From 567b0cc8ea39608c8ab095c5c5c21668b0a2e1de Mon Sep 17 00:00:00 2001 From: Denis Zharkov Date: Mon, 26 Sep 2016 10:41:46 +0300 Subject: [PATCH] Add a couple of covariant necessary overrides They become unavoidable after checking override conflicts for delegation members --- .../resolve/calls/util/FakeCallableDescriptorForObject.kt | 4 ++++ .../kotlin/resolve/scopes/SubpackagesImportingScope.kt | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/util/FakeCallableDescriptorForObject.kt b/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/util/FakeCallableDescriptorForObject.kt index 5f19caa5d3f..e5325be02bf 100644 --- a/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/util/FakeCallableDescriptorForObject.kt +++ b/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/util/FakeCallableDescriptorForObject.kt @@ -21,6 +21,7 @@ import org.jetbrains.kotlin.resolve.descriptorUtil.classValueType import org.jetbrains.kotlin.resolve.descriptorUtil.getClassObjectReferenceTarget import org.jetbrains.kotlin.resolve.descriptorUtil.hasClassValueDescriptor import org.jetbrains.kotlin.types.KotlinType +import org.jetbrains.kotlin.types.TypeSubstitutor import java.util.* open class FakeCallableDescriptorForObject( @@ -69,4 +70,7 @@ open class FakeCallableDescriptorForObject( override fun equals(other: Any?) = other is FakeCallableDescriptorForObject && classDescriptor == other.classDescriptor override fun hashCode() = classDescriptor.hashCode() + + override fun getContainingDeclaration() = classDescriptor.getClassObjectReferenceTarget().containingDeclaration + override fun substitute(substitutor: TypeSubstitutor) = TODO("Substitution of FakeCallableDescriptorForObject is not supported") } diff --git a/compiler/resolution/src/org/jetbrains/kotlin/resolve/scopes/SubpackagesImportingScope.kt b/compiler/resolution/src/org/jetbrains/kotlin/resolve/scopes/SubpackagesImportingScope.kt index 7ed65c2ce61..ddb45268033 100644 --- a/compiler/resolution/src/org/jetbrains/kotlin/resolve/scopes/SubpackagesImportingScope.kt +++ b/compiler/resolution/src/org/jetbrains/kotlin/resolve/scopes/SubpackagesImportingScope.kt @@ -19,6 +19,7 @@ package org.jetbrains.kotlin.resolve.scopes import org.jetbrains.kotlin.descriptors.ModuleDescriptor import org.jetbrains.kotlin.descriptors.PackageViewDescriptor import org.jetbrains.kotlin.descriptors.impl.SubpackagesScope +import org.jetbrains.kotlin.incremental.components.LookupLocation import org.jetbrains.kotlin.name.FqName import org.jetbrains.kotlin.name.Name import org.jetbrains.kotlin.utils.Printer @@ -32,4 +33,7 @@ class SubpackagesImportingScope( override fun getContributedPackage(name: Name): PackageViewDescriptor? = getPackage(name) override fun printStructure(p: Printer) = printScopeStructure(p) -} \ No newline at end of file + + override fun getContributedVariables(name: Name, location: LookupLocation) = super.getContributedVariables(name, location) + override fun getContributedFunctions(name: Name, location: LookupLocation) = super.getContributedFunctions(name, location) +}