[FIR] Fix diagnostic message rendering for OVERRIDE_DEPRECATION
This commit is contained in:
committed by
TeamCityServer
parent
9f4abd8ff7
commit
661d89c67f
+3
-2
@@ -14,6 +14,7 @@ import org.jetbrains.kotlin.diagnostics.rendering.Renderers.commaSeparated
|
|||||||
import org.jetbrains.kotlin.fir.analysis.diagnostics.FirDiagnosticRenderers.AMBIGUOUS_CALLS
|
import org.jetbrains.kotlin.fir.analysis.diagnostics.FirDiagnosticRenderers.AMBIGUOUS_CALLS
|
||||||
import org.jetbrains.kotlin.fir.analysis.diagnostics.FirDiagnosticRenderers.COLLECTION
|
import org.jetbrains.kotlin.fir.analysis.diagnostics.FirDiagnosticRenderers.COLLECTION
|
||||||
import org.jetbrains.kotlin.fir.analysis.diagnostics.FirDiagnosticRenderers.DECLARATION_NAME
|
import org.jetbrains.kotlin.fir.analysis.diagnostics.FirDiagnosticRenderers.DECLARATION_NAME
|
||||||
|
import org.jetbrains.kotlin.fir.analysis.diagnostics.FirDiagnosticRenderers.EMPTY
|
||||||
import org.jetbrains.kotlin.fir.analysis.diagnostics.FirDiagnosticRenderers.FIR
|
import org.jetbrains.kotlin.fir.analysis.diagnostics.FirDiagnosticRenderers.FIR
|
||||||
import org.jetbrains.kotlin.fir.analysis.diagnostics.FirDiagnosticRenderers.FQ_NAMES_IN_TYPES
|
import org.jetbrains.kotlin.fir.analysis.diagnostics.FirDiagnosticRenderers.FQ_NAMES_IN_TYPES
|
||||||
import org.jetbrains.kotlin.fir.analysis.diagnostics.FirDiagnosticRenderers.FUNCTION_PARAMETERS
|
import org.jetbrains.kotlin.fir.analysis.diagnostics.FirDiagnosticRenderers.FUNCTION_PARAMETERS
|
||||||
@@ -671,8 +672,8 @@ class FirDefaultErrorMessages {
|
|||||||
map.put(
|
map.put(
|
||||||
OVERRIDE_DEPRECATION,
|
OVERRIDE_DEPRECATION,
|
||||||
"This declaration overrides deprecated member but not marked as deprecated itself. Please add @Deprecated annotation or suppress",
|
"This declaration overrides deprecated member but not marked as deprecated itself. Please add @Deprecated annotation or suppress",
|
||||||
TO_STRING,
|
EMPTY,
|
||||||
TO_STRING
|
EMPTY
|
||||||
)
|
)
|
||||||
map.put(ANNOTATION_ON_SUPERCLASS, "Annotations on superclass are meaningless")
|
map.put(ANNOTATION_ON_SUPERCLASS, "Annotations on superclass are meaningless")
|
||||||
map.put(WRONG_ANNOTATION_TARGET, "This annotation is not applicable to target ''{0}''", TO_STRING)
|
map.put(WRONG_ANNOTATION_TARGET, "This annotation is not applicable to target ''{0}''", TO_STRING)
|
||||||
|
|||||||
+2
@@ -49,6 +49,8 @@ object FirDiagnosticRenderers {
|
|||||||
element.toString()
|
element.toString()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
val EMPTY = Renderer { _: Any? -> "" }
|
||||||
|
|
||||||
val VARIABLE_NAME = Renderer { symbol: FirVariableSymbol<*> ->
|
val VARIABLE_NAME = Renderer { symbol: FirVariableSymbol<*> ->
|
||||||
symbol.name.asString()
|
symbol.name.asString()
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -16,7 +16,7 @@ interface WithDeprecation {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class A : J(), WithDeprecation {
|
class A : J(), WithDeprecation {
|
||||||
override fun <!OVERRIDE_DEPRECATION!>foo<!>() {}
|
override fun <!OVERRIDE_DEPRECATION("")!>foo<!>() {}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun main() {
|
fun main() {
|
||||||
|
|||||||
Reference in New Issue
Block a user