diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/checkers/MissingDependencySupertypeChecker.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/checkers/MissingDependencySupertypeChecker.kt index c85695a0ac5..cd5c71e2d89 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/checkers/MissingDependencySupertypeChecker.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/checkers/MissingDependencySupertypeChecker.kt @@ -16,6 +16,7 @@ import org.jetbrains.kotlin.resolve.MissingSupertypesResolver import org.jetbrains.kotlin.resolve.calls.checkers.CallChecker import org.jetbrains.kotlin.resolve.calls.checkers.CallCheckerContext import org.jetbrains.kotlin.resolve.calls.model.ResolvedCall +import org.jetbrains.kotlin.resolve.calls.util.FakeCallableDescriptorForObject import org.jetbrains.kotlin.resolve.descriptorUtil.fqNameSafe import org.jetbrains.kotlin.types.KotlinType @@ -47,7 +48,7 @@ object MissingDependencySupertypeChecker { descriptor.dispatchReceiverParameter?.declaration, reportOn, context.trace, context.missingSupertypesResolver ) - if (descriptor !is ConstructorDescriptor && !errorReported) { + if (descriptor !is ConstructorDescriptor && descriptor !is FakeCallableDescriptorForObject && !errorReported) { // The constructed class' own supertypes are not resolved after constructor call, // so its containing declaration should not be checked. // Dispatch receiver is checked before for case of inner class constructor call. diff --git a/compiler/testData/compileKotlinAgainstCustomBinaries/incompleteHierarchyNoErrors/library/test/SubKt.kt b/compiler/testData/compileKotlinAgainstCustomBinaries/incompleteHierarchyNoErrors/library/test/SubKt.kt new file mode 100644 index 00000000000..e14b52fe04f --- /dev/null +++ b/compiler/testData/compileKotlinAgainstCustomBinaries/incompleteHierarchyNoErrors/library/test/SubKt.kt @@ -0,0 +1,11 @@ +package test + +class SubKt : Super() { + companion object { + fun companionMethod() = "OK" + } + + object InnerObject { + fun objectMethod() = "OK" + } +} \ No newline at end of file diff --git a/compiler/testData/compileKotlinAgainstCustomBinaries/incompleteHierarchyNoErrors/source.kt b/compiler/testData/compileKotlinAgainstCustomBinaries/incompleteHierarchyNoErrors/source.kt index 57080494bed..c7f25b828e5 100644 --- a/compiler/testData/compileKotlinAgainstCustomBinaries/incompleteHierarchyNoErrors/source.kt +++ b/compiler/testData/compileKotlinAgainstCustomBinaries/incompleteHierarchyNoErrors/source.kt @@ -1,4 +1,5 @@ -import test.Sub as MySub; +import test.Sub as MySub +import test.SubKt typealias Sub = MySub @@ -21,4 +22,6 @@ fun test() { useCallRef(::Sub) simpleFun(Sub()) inlineFun(Sub()) + SubKt.companionMethod() + SubKt.InnerObject.objectMethod() }