From 7f4f07659ca2774ce36c7694c07c91e7ca949c44 Mon Sep 17 00:00:00 2001 From: Denis Zharkov Date: Thu, 30 Aug 2018 12:48:40 +0300 Subject: [PATCH] Minor. Move Deprecation and DeprecationLevel interfaces to core --- .../kotlin/resolve/deprecationUtil.kt | 11 ---------- .../jetbrains/kotlin/resolve/deprecation.kt | 20 +++++++++++++++++++ 2 files changed, 20 insertions(+), 11 deletions(-) create mode 100644 core/descriptors/src/org/jetbrains/kotlin/resolve/deprecation.kt diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/deprecationUtil.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/deprecationUtil.kt index a17ce004812..e1cb0d1c7e6 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/deprecationUtil.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/deprecationUtil.kt @@ -50,12 +50,6 @@ import org.jetbrains.kotlin.utils.addToStdlib.safeAs private val JAVA_DEPRECATED = FqName("java.lang.Deprecated") -interface Deprecation { - val deprecationLevel: DeprecationLevelValue - val message: String? - val target: DeclarationDescriptor -} - fun Deprecation.deprecatedByOverriddenMessage(): String? = (this as? DeprecatedByOverridden)?.additionalMessage() fun Deprecation.deprecatedByAnnotationReplaceWithExpression(): String? { @@ -214,11 +208,6 @@ internal fun createDeprecationDiagnostic( } } -// values from kotlin.DeprecationLevel -enum class DeprecationLevelValue { - WARNING, ERROR, HIDDEN -} - @DefaultImplementation(CoroutineCompatibilitySupport::class) class CoroutineCompatibilitySupport private constructor(val enabled: Boolean) { constructor() : this(true) diff --git a/core/descriptors/src/org/jetbrains/kotlin/resolve/deprecation.kt b/core/descriptors/src/org/jetbrains/kotlin/resolve/deprecation.kt new file mode 100644 index 00000000000..d6a75741e6f --- /dev/null +++ b/core/descriptors/src/org/jetbrains/kotlin/resolve/deprecation.kt @@ -0,0 +1,20 @@ +/* + * Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.resolve + +import org.jetbrains.kotlin.descriptors.DeclarationDescriptor + +interface Deprecation { + val deprecationLevel: DeprecationLevelValue + val message: String? + val target: DeclarationDescriptor +} + +// values from kotlin.DeprecationLevel +enum class DeprecationLevelValue { + WARNING, ERROR, HIDDEN +} +