diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/deprecationUtil.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/deprecationUtil.kt index 50dea404ea0..624053b8860 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/deprecationUtil.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/deprecationUtil.kt @@ -112,7 +112,7 @@ private fun deprecationByOverridden(root: CallableMemberDescriptor): Deprecation return } else -> { - overriddenDescriptors.forEach { traverse(it) } + overriddenDescriptors.forEach(::traverse) } } } @@ -147,13 +147,6 @@ private fun DeclarationDescriptor.getDeprecationByAnnotation(): DeprecatedByAnno val propertyAnnotation = propertyDescriptor.getDeclaredDeprecatedAnnotation() if (propertyAnnotation != null) return DeprecatedByAnnotation(propertyAnnotation, propertyDescriptor) - - val classDescriptor = containingDeclaration as? ClassDescriptor - if (classDescriptor != null && classDescriptor.isCompanionObject) { - val classAnnotation = classDescriptor.getDeclaredDeprecatedAnnotation() - if (classAnnotation != null) - return DeprecatedByAnnotation(classAnnotation, classDescriptor) - } } } return null diff --git a/compiler/testData/diagnostics/tests/deprecated/companionObjectUsage.kt b/compiler/testData/diagnostics/tests/deprecated/companionObjectUsage.kt index 1d8dc3baece..2ad875d30b7 100644 --- a/compiler/testData/diagnostics/tests/deprecated/companionObjectUsage.kt +++ b/compiler/testData/diagnostics/tests/deprecated/companionObjectUsage.kt @@ -8,8 +8,8 @@ class Another { fun first() { Another.use() - Another.Companion.USE // TODO - Another.USE // TODO + Another.Companion.USE + Another.USE } fun useCompanion() { diff --git a/idea/testData/highlighter/deprecated/ClassObject.kt b/idea/testData/highlighter/deprecated/ClassObject.kt index dc745a8ec4e..61ec78da6bf 100644 --- a/idea/testData/highlighter/deprecated/ClassObject.kt +++ b/idea/testData/highlighter/deprecated/ClassObject.kt @@ -1,13 +1,13 @@ fun test() { - MyClass.test + MyClass.test MyClass() val a: MyClass? = null val b: MyTrait? = null - MyTrait.test + MyTrait.test MyTrait.Companion MyTrait MyClass.Companion - MyClass.Companion.test + MyClass.Companion.test a == b }