[FE 1.0] Fix diagnostic message rendering for OVERRIDE_DEPRECATION
This commit is contained in:
committed by
TeamCityServer
parent
9844671ded
commit
9f4abd8ff7
+1
-1
@@ -394,7 +394,7 @@ public class DefaultErrorMessages {
|
||||
(obj, renderingContext) -> obj.equals(VersionRequirement.Version.INFINITY) ? "" : " is only available since Kotlin " + obj.asString() + " and",
|
||||
versionRequirementMessage);
|
||||
|
||||
MAP.put(OVERRIDE_DEPRECATION, "This declaration overrides deprecated member but not marked as deprecated itself. {0}Please add @Deprecated annotation or suppress", TO_STRING, TO_STRING, TO_STRING);
|
||||
MAP.put(OVERRIDE_DEPRECATION, "This declaration overrides deprecated member but not marked as deprecated itself. {0}Please add @Deprecated annotation or suppress", TO_STRING, EMPTY, EMPTY);
|
||||
|
||||
MAP.put(DEPRECATED_SINCE_KOTLIN_WITHOUT_DEPRECATED, "DeprecatedSinceKotlin annotation can be used only together with Deprecated annotation");
|
||||
MAP.put(DEPRECATED_SINCE_KOTLIN_WITH_DEPRECATED_LEVEL, "DeprecatedSinceKotlin annotation can be used only with unspecified deprecation level of Deprecated annotation");
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ object DeprecationInheritanceChecker : DeclarationChecker {
|
||||
val (deprecations, message) = if (context.languageVersionSettings.supportsFeature(StopPropagatingDeprecationThroughOverrides)) {
|
||||
deprecationResolver.getHiddenDeprecationsFromOverriden(descriptor) to ""
|
||||
} else {
|
||||
deprecationResolver.getDeprecations(descriptor) to "This deprecation won't be inherited in kotlin 1.7. "
|
||||
deprecationResolver.getDeprecations(descriptor) to "This deprecation won't be inherited in future releases. "
|
||||
}
|
||||
context.trace.report(Errors.OVERRIDE_DEPRECATION.on(declaration, message, descriptor, deprecations))
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ interface WithDeprecation {
|
||||
}
|
||||
|
||||
class A : J(), WithDeprecation {
|
||||
override fun <!OVERRIDE_DEPRECATION!>foo<!>() {}
|
||||
override fun <!OVERRIDE_DEPRECATION("This deprecation won't be inherited in future releases. ")!>foo<!>() {}
|
||||
}
|
||||
|
||||
fun main() {
|
||||
|
||||
Reference in New Issue
Block a user