Report custom diagnostic instead of symbol deprecation

For annotations that should be replaced with modifiers
This commit is contained in:
Denis Zharkov
2015-09-09 15:56:42 +03:00
parent c3cb6b62f4
commit 04483eb826
7 changed files with 23 additions and 9 deletions
-1
View File
@@ -82,7 +82,6 @@ public annotation class Suppress(vararg val names: String)
* backend.
*/
@Target(FUNCTION)
@Deprecated("Use kotlin.tailrec instead", ReplaceWith("kotlin.tailrec"))
@Retention(SOURCE)
public annotation class tailRecursive
-1
View File
@@ -50,7 +50,6 @@ public annotation class inline
@Target(AnnotationTarget.VALUE_PARAMETER)
@Retention(AnnotationRetention.RUNTIME)
@MustBeDocumented
@Deprecated("Use 'crossinline' modifier instead of 'inlineOptions(InlineOption.ONLY_LOCAL_RETURN)'")
public annotation class inlineOptions(vararg val value: InlineOption)
/**
@@ -18,6 +18,20 @@ package org.jetbrains.kotlin.descriptors.annotations
import org.jetbrains.kotlin.name.FqName
val ADDITIONAL_ANNOTATIONS_MAP: Map<FqName, String> = mapOf(
FqName("kotlin.tailRecursive") to "tailrec",
FqName("kotlin.jvm.native") to "external",
FqName("kotlin.inlineOptions") to "crossinline"
)
// Please synchronize this set with JetTokens.ANNOTATION_MODIFIERS_KEYWORDS_ARRAY
public val ANNOTATION_MODIFIERS_FQ_NAMES: Set<FqName> =
arrayOf("data", "inline", "noinline", "tailrec", "external", "annotation.annotation", "crossinline").map { FqName("kotlin.$it") }.toSet()
public val ANNOTATIONS_SHOULD_BE_REPLACED_WITH_MODIFIERS_FQ_NAMES: Set<FqName> =
ANNOTATION_MODIFIERS_FQ_NAMES + ADDITIONAL_ANNOTATIONS_MAP.keySet()
public val ANNOTATION_MODIFIERS_MAP: Map<FqName, String> =
ANNOTATION_MODIFIERS_FQ_NAMES.map { it to it.shortName().asString() }.toMap() +
ADDITIONAL_ANNOTATIONS_MAP