Unify Deprecation classes from :core:compiler.common and :compiler:frontend modules

This commit is contained in:
Dmitriy Novozhilov
2021-08-27 12:51:16 +03:00
parent be999564b1
commit 762d225bd7
18 changed files with 108 additions and 108 deletions
@@ -8,16 +8,11 @@ package org.jetbrains.kotlin.resolve.deprecation
import org.jetbrains.kotlin.descriptors.CallableDescriptor
import org.jetbrains.kotlin.descriptors.DeclarationDescriptor
interface Deprecation {
val deprecationLevel: DeprecationLevelValue
val message: String?
val target: DeclarationDescriptor
val propagatesToOverrides: Boolean get() = true
abstract class DescriptorBasedDeprecation : Deprecation() {
override val propagatesToOverrides: Boolean
get() = true
abstract val target: DeclarationDescriptor
}
// values from kotlin.DeprecationLevel
enum class DeprecationLevelValue {
WARNING, ERROR, HIDDEN
}
val DEPRECATED_FUNCTION_KEY = object : CallableDescriptor.UserDataKey<Deprecation> {}
val DEPRECATED_FUNCTION_KEY = object : CallableDescriptor.UserDataKey<DescriptorBasedDeprecation> {}