Prohibit using DeprecatedSinceKotlin outside kotlin subpackage

This commit is contained in:
Mikhail Zarechenskiy
2020-06-18 18:26:49 +03:00
parent 790433984b
commit a2da00eb49
33 changed files with 168 additions and 72 deletions
@@ -6667,6 +6667,11 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirOldFronte
runTest("compiler/testData/diagnostics/tests/deprecated/deprecatedSinceKotlin/deprecatedSinceKotlinDeclaration.kt");
}
@TestMetadata("deprecatedSinceKotlinOutsideKotlinPackage.kt")
public void testDeprecatedSinceKotlinOutsideKotlinPackage() throws Exception {
runTest("compiler/testData/diagnostics/tests/deprecated/deprecatedSinceKotlin/deprecatedSinceKotlinOutsideKotlinPackage.kt");
}
@TestMetadata("deprecatedSinceKotlinWithoutArguments.kt")
public void testDeprecatedSinceKotlinWithoutArguments() throws Exception {
runTest("compiler/testData/diagnostics/tests/deprecated/deprecatedSinceKotlin/deprecatedSinceKotlinWithoutArguments.kt");
@@ -104,6 +104,7 @@ public interface Errors {
DiagnosticFactory0<PsiElement> DEPRECATED_SINCE_KOTLIN_WITH_DEPRECATED_LEVEL = DiagnosticFactory0.create(ERROR);
DiagnosticFactory0<PsiElement> DEPRECATED_SINCE_KOTLIN_WITH_UNORDERED_VERSIONS = DiagnosticFactory0.create(ERROR);
DiagnosticFactory0<PsiElement> DEPRECATED_SINCE_KOTLIN_WITHOUT_ARGUMENTS = DiagnosticFactory0.create(ERROR);
DiagnosticFactory0<PsiElement> DEPRECATED_SINCE_KOTLIN_OUTSIDE_KOTLIN_SUBPACKAGE = DiagnosticFactory0.create(ERROR);
DiagnosticFactory2<PsiElement, String, String> API_NOT_AVAILABLE = DiagnosticFactory2.create(ERROR);
@@ -381,6 +381,7 @@ public class DefaultErrorMessages {
MAP.put(DEPRECATED_SINCE_KOTLIN_WITH_DEPRECATED_LEVEL, "DeprecatedSinceKotlin annotation can be used only with unspecified deprecation level of Deprecated annotation");
MAP.put(DEPRECATED_SINCE_KOTLIN_WITH_UNORDERED_VERSIONS, "Values of DeprecatedSinceKotlin annotation should be ordered so 'warningSince' <= 'errorSince' <= 'hiddenSince' if specified");
MAP.put(DEPRECATED_SINCE_KOTLIN_WITHOUT_ARGUMENTS, "DeprecatedSinceKotlin annotation should have at least one argument");
MAP.put(DEPRECATED_SINCE_KOTLIN_OUTSIDE_KOTLIN_SUBPACKAGE, "DeprecatedSinceKotlin annotation cannot be used outside 'kotlin' subpackages");
MAP.put(API_NOT_AVAILABLE, "This declaration is only available since Kotlin {0} and cannot be used with the specified API version {1}", STRING, STRING);
@@ -12,12 +12,14 @@ import org.jetbrains.kotlin.descriptors.DeclarationDescriptor
import org.jetbrains.kotlin.descriptors.annotations.AnnotationDescriptor
import org.jetbrains.kotlin.diagnostics.Errors
import org.jetbrains.kotlin.diagnostics.reportDiagnosticOnce
import org.jetbrains.kotlin.name.isSubpackageOf
import org.jetbrains.kotlin.psi.KtAnnotationEntry
import org.jetbrains.kotlin.psi.KtDeclaration
import org.jetbrains.kotlin.resolve.RequireKotlinConstants
import org.jetbrains.kotlin.resolve.annotations.argumentValue
import org.jetbrains.kotlin.resolve.constants.StringValue
import org.jetbrains.kotlin.resolve.deprecation.getSinceVersion
import org.jetbrains.kotlin.resolve.descriptorUtil.fqNameOrNull
import org.jetbrains.kotlin.resolve.source.getPsi
import org.jetbrains.kotlin.utils.addToStdlib.safeAs
@@ -30,6 +32,15 @@ object DeprecatedSinceKotlinAnnotationChecker : DeclarationChecker {
val deprecatedSinceAnnotationName = deprecatedSinceAnnotationPsi.typeReference ?: return
if (descriptor.fqNameOrNull()?.isSubpackageOf(KotlinBuiltIns.BUILT_INS_PACKAGE_FQ_NAME) == false) {
context.trace.report(
Errors.DEPRECATED_SINCE_KOTLIN_OUTSIDE_KOTLIN_SUBPACKAGE.on(
deprecatedSinceAnnotationName
)
)
return
}
if (deprecatedAnnotation == null) {
context.trace.report(
Errors.DEPRECATED_SINCE_KOTLIN_WITHOUT_DEPRECATED.on(
@@ -1,3 +1,5 @@
package kotlin
@Deprecated("")
@DeprecatedSinceKotlin("", errorSince = "1.0")
fun test1() {}
@@ -1,3 +1,5 @@
package kotlin
@Deprecated("")
@<!ILLEGAL_KOTLIN_VERSION_STRING_VALUE!>DeprecatedSinceKotlin<!>("", errorSince = "1.0")
fun test1() {}
@@ -1,7 +1,9 @@
package
@kotlin.Deprecated(message = "") @kotlin.DeprecatedSinceKotlin(errorSince = "1.0", warningSince = "") public fun test1(): kotlin.Unit
@kotlin.Deprecated(message = "") @kotlin.DeprecatedSinceKotlin(warningSince = "") public fun test2(): kotlin.Unit
@kotlin.Deprecated(message = "") @kotlin.DeprecatedSinceKotlin(errorSince = "", hiddenSince = "", warningSince = "") public fun test3(): kotlin.Unit
@kotlin.Deprecated(message = "") @kotlin.DeprecatedSinceKotlin(warningSince = "1.4-M2") public fun test4(): kotlin.Unit
@kotlin.Deprecated(message = "") @kotlin.DeprecatedSinceKotlin(warningSince = "1.3.70") public fun test5(): kotlin.Unit
package kotlin {
@kotlin.Deprecated(message = "") @kotlin.DeprecatedSinceKotlin(errorSince = "1.0", warningSince = "") public fun test1(): kotlin.Unit
@kotlin.Deprecated(message = "") @kotlin.DeprecatedSinceKotlin(warningSince = "") public fun test2(): kotlin.Unit
@kotlin.Deprecated(message = "") @kotlin.DeprecatedSinceKotlin(errorSince = "", hiddenSince = "", warningSince = "") public fun test3(): kotlin.Unit
@kotlin.Deprecated(message = "") @kotlin.DeprecatedSinceKotlin(warningSince = "1.4-M2") public fun test4(): kotlin.Unit
@kotlin.Deprecated(message = "") @kotlin.DeprecatedSinceKotlin(warningSince = "1.3.70") public fun test5(): kotlin.Unit
}
@@ -1,3 +1,5 @@
package kotlin.sub
@Deprecated("", ReplaceWith(""))
@DeprecatedSinceKotlin(warningSince = "1.0", errorSince = "1.1", hiddenSince = "1.2")
fun good() {}
@@ -1,3 +1,5 @@
package kotlin.sub
@Deprecated("", ReplaceWith(""))
@DeprecatedSinceKotlin(warningSince = "1.0", errorSince = "1.1", hiddenSince = "1.2")
fun good() {}
@@ -1,19 +1,24 @@
package
@kotlin.Deprecated(message = "") @kotlin.DeprecatedSinceKotlin(errorSince = "1.1", hiddenSince = "1.1", warningSince = "1.2") public fun fooDefault(): kotlin.Unit
@kotlin.Deprecated(level = DeprecationLevel.WARNING, message = "", replaceWith = kotlin.ReplaceWith(expression = "", imports = {})) @kotlin.DeprecatedSinceKotlin public fun fooDefaultWarning(): kotlin.Unit
@kotlin.Deprecated(message = "") @kotlin.DeprecatedSinceKotlin(errorSince = "1.1", hiddenSince = "1.1", warningSince = "1.1") public fun fooEqual(): kotlin.Unit
@kotlin.Deprecated(level = DeprecationLevel.ERROR, message = "") @kotlin.DeprecatedSinceKotlin public fun fooError(): kotlin.Unit
@kotlin.Deprecated(message = "") @kotlin.DeprecatedSinceKotlin(errorSince = "1.3", hiddenSince = "1.2", warningSince = "1.1") public fun fooErrorIsGreater(): kotlin.Unit
@kotlin.Deprecated(level = DeprecationLevel.HIDDEN, message = "") @kotlin.DeprecatedSinceKotlin public fun fooHidden(): kotlin.Unit
@kotlin.Deprecated(level = DeprecationLevel.WARNING, message = "") @kotlin.DeprecatedSinceKotlin public fun fooWarning(): kotlin.Unit
@kotlin.Deprecated(message = "") @kotlin.DeprecatedSinceKotlin(errorSince = "1.0", warningSince = "1.1") public fun fooWarningIsGreater1(): kotlin.Unit
@kotlin.Deprecated(message = "") @kotlin.DeprecatedSinceKotlin(hiddenSince = "1.0", warningSince = "1.1") public fun fooWarningIsGreater2(): kotlin.Unit
@kotlin.Deprecated(message = "", replaceWith = kotlin.ReplaceWith(expression = "", imports = {})) @kotlin.DeprecatedSinceKotlin(errorSince = "1.1", hiddenSince = "1.2", warningSince = "1.0") public fun good(): kotlin.Unit
package kotlin {
@kotlin.DeprecatedSinceKotlin public final class Clazz {
public constructor Clazz()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
package kotlin.sub {
@kotlin.Deprecated(message = "") @kotlin.DeprecatedSinceKotlin(errorSince = "1.1", hiddenSince = "1.1", warningSince = "1.2") public fun fooDefault(): kotlin.Unit
@kotlin.Deprecated(level = DeprecationLevel.WARNING, message = "", replaceWith = kotlin.ReplaceWith(expression = "", imports = {})) @kotlin.DeprecatedSinceKotlin public fun fooDefaultWarning(): kotlin.Unit
@kotlin.Deprecated(message = "") @kotlin.DeprecatedSinceKotlin(errorSince = "1.1", hiddenSince = "1.1", warningSince = "1.1") public fun fooEqual(): kotlin.Unit
@kotlin.Deprecated(level = DeprecationLevel.ERROR, message = "") @kotlin.DeprecatedSinceKotlin public fun fooError(): kotlin.Unit
@kotlin.Deprecated(message = "") @kotlin.DeprecatedSinceKotlin(errorSince = "1.3", hiddenSince = "1.2", warningSince = "1.1") public fun fooErrorIsGreater(): kotlin.Unit
@kotlin.Deprecated(level = DeprecationLevel.HIDDEN, message = "") @kotlin.DeprecatedSinceKotlin public fun fooHidden(): kotlin.Unit
@kotlin.Deprecated(level = DeprecationLevel.WARNING, message = "") @kotlin.DeprecatedSinceKotlin public fun fooWarning(): kotlin.Unit
@kotlin.Deprecated(message = "") @kotlin.DeprecatedSinceKotlin(errorSince = "1.0", warningSince = "1.1") public fun fooWarningIsGreater1(): kotlin.Unit
@kotlin.Deprecated(message = "") @kotlin.DeprecatedSinceKotlin(hiddenSince = "1.0", warningSince = "1.1") public fun fooWarningIsGreater2(): kotlin.Unit
@kotlin.Deprecated(message = "", replaceWith = kotlin.ReplaceWith(expression = "", imports = {})) @kotlin.DeprecatedSinceKotlin(errorSince = "1.1", hiddenSince = "1.2", warningSince = "1.0") public fun good(): kotlin.Unit
@kotlin.DeprecatedSinceKotlin public final class Clazz {
public constructor Clazz()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
}
}
@@ -0,0 +1,5 @@
package foo.bar
@Deprecated("")
@DeprecatedSinceKotlin("1.3")
fun test() {}
@@ -0,0 +1,5 @@
package foo.bar
@Deprecated("")
@<!DEPRECATED_SINCE_KOTLIN_OUTSIDE_KOTLIN_SUBPACKAGE!>DeprecatedSinceKotlin<!>("1.3")
fun test() {}
@@ -0,0 +1,8 @@
package
package foo {
package foo.bar {
@kotlin.Deprecated(message = "") @kotlin.DeprecatedSinceKotlin(warningSince = "1.3") public fun test(): kotlin.Unit
}
}
@@ -1,3 +1,5 @@
package kotlin
@Deprecated("")
@DeprecatedSinceKotlin
fun foo() {}
@@ -1,3 +1,5 @@
package kotlin
@Deprecated("")
@<!DEPRECATED_SINCE_KOTLIN_WITHOUT_ARGUMENTS!>DeprecatedSinceKotlin<!>
fun foo() {}
@@ -1,4 +1,6 @@
package
@kotlin.Deprecated(message = "") @kotlin.DeprecatedSinceKotlin public fun foo(): kotlin.Unit
public fun test(): kotlin.Unit
package kotlin {
@kotlin.Deprecated(message = "") @kotlin.DeprecatedSinceKotlin public fun foo(): kotlin.Unit
public fun test(): kotlin.Unit
}
@@ -1,5 +1,7 @@
// !API_VERSION: 1.4
package kotlin
@Deprecated("")
@DeprecatedSinceKotlin(errorSince = "1.4")
class ClassCur
@@ -1,5 +1,7 @@
// !API_VERSION: 1.4
package kotlin
@Deprecated("")
@DeprecatedSinceKotlin(errorSince = "1.4")
class ClassCur
@@ -1,21 +1,23 @@
package
@kotlin.Deprecated(message = "") @kotlin.DeprecatedSinceKotlin(errorSince = "1.4") public val valCur: kotlin.Unit
@kotlin.Deprecated(message = "") @kotlin.DeprecatedSinceKotlin(errorSince = "1.5") public val valNext: kotlin.Unit
@kotlin.Deprecated(message = "") @kotlin.DeprecatedSinceKotlin(errorSince = "1.4") public fun funCur(): kotlin.Unit
@kotlin.Deprecated(message = "") @kotlin.DeprecatedSinceKotlin(errorSince = "1.5") public fun funNext(): kotlin.Unit
public fun usage(): kotlin.Unit
package kotlin {
@kotlin.Deprecated(message = "") @kotlin.DeprecatedSinceKotlin(errorSince = "1.4") public val valCur: kotlin.Unit
@kotlin.Deprecated(message = "") @kotlin.DeprecatedSinceKotlin(errorSince = "1.5") public val valNext: kotlin.Unit
@kotlin.Deprecated(message = "") @kotlin.DeprecatedSinceKotlin(errorSince = "1.4") public fun funCur(): kotlin.Unit
@kotlin.Deprecated(message = "") @kotlin.DeprecatedSinceKotlin(errorSince = "1.5") public fun funNext(): kotlin.Unit
public fun usage(): kotlin.Unit
@kotlin.Deprecated(message = "") @kotlin.DeprecatedSinceKotlin(errorSince = "1.4") public final class ClassCur {
public constructor ClassCur()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
@kotlin.Deprecated(message = "") @kotlin.DeprecatedSinceKotlin(errorSince = "1.4") public final class ClassCur {
public constructor ClassCur()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
@kotlin.Deprecated(message = "") @kotlin.DeprecatedSinceKotlin(errorSince = "1.5") public final class ClassNext {
public constructor ClassNext()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
@kotlin.Deprecated(message = "") @kotlin.DeprecatedSinceKotlin(errorSince = "1.5") public final class ClassNext {
public constructor ClassNext()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
}
@@ -1,5 +1,7 @@
// !API_VERSION: 1.4
package kotlin
@Deprecated("")
@DeprecatedSinceKotlin(hiddenSince = "1.4")
class ClassCur
@@ -1,5 +1,7 @@
// !API_VERSION: 1.4
package kotlin
@Deprecated("")
@DeprecatedSinceKotlin(hiddenSince = "1.4")
class ClassCur
@@ -1,21 +1,23 @@
package
@kotlin.Deprecated(message = "") @kotlin.DeprecatedSinceKotlin(hiddenSince = "1.4") public val valCur: kotlin.Unit
@kotlin.Deprecated(message = "") @kotlin.DeprecatedSinceKotlin(hiddenSince = "1.5") public val valNext: kotlin.Unit
@kotlin.Deprecated(message = "") @kotlin.DeprecatedSinceKotlin(hiddenSince = "1.4") public fun funCur(): kotlin.Unit
@kotlin.Deprecated(message = "") @kotlin.DeprecatedSinceKotlin(hiddenSince = "1.5") public fun funNext(): kotlin.Unit
public fun usage(): kotlin.Unit
package kotlin {
@kotlin.Deprecated(message = "") @kotlin.DeprecatedSinceKotlin(hiddenSince = "1.4") public val valCur: kotlin.Unit
@kotlin.Deprecated(message = "") @kotlin.DeprecatedSinceKotlin(hiddenSince = "1.5") public val valNext: kotlin.Unit
@kotlin.Deprecated(message = "") @kotlin.DeprecatedSinceKotlin(hiddenSince = "1.4") public fun funCur(): kotlin.Unit
@kotlin.Deprecated(message = "") @kotlin.DeprecatedSinceKotlin(hiddenSince = "1.5") public fun funNext(): kotlin.Unit
public fun usage(): kotlin.Unit
@kotlin.Deprecated(message = "") @kotlin.DeprecatedSinceKotlin(hiddenSince = "1.4") public final class ClassCur {
public constructor ClassCur()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
@kotlin.Deprecated(message = "") @kotlin.DeprecatedSinceKotlin(hiddenSince = "1.4") public final class ClassCur {
public constructor ClassCur()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
@kotlin.Deprecated(message = "") @kotlin.DeprecatedSinceKotlin(hiddenSince = "1.5") public final class ClassNext {
public constructor ClassNext()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
@kotlin.Deprecated(message = "") @kotlin.DeprecatedSinceKotlin(hiddenSince = "1.5") public final class ClassNext {
public constructor ClassNext()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
}
@@ -1,3 +1,5 @@
package kotlin
@Deprecated("foo test")
@DeprecatedSinceKotlin(warningSince = "1.0")
fun foo() {}
@@ -1,3 +1,5 @@
package kotlin
@Deprecated("foo test")
@DeprecatedSinceKotlin(warningSince = "1.0")
fun foo() {}
@@ -1,4 +1,6 @@
package
@kotlin.Deprecated(message = "foo test") @kotlin.DeprecatedSinceKotlin(warningSince = "1.0") public fun foo(): kotlin.Unit
public fun test(): kotlin.Unit
package kotlin {
@kotlin.Deprecated(message = "foo test") @kotlin.DeprecatedSinceKotlin(warningSince = "1.0") public fun foo(): kotlin.Unit
public fun test(): kotlin.Unit
}
@@ -1,5 +1,7 @@
// !API_VERSION: 1.4
package kotlin
@Deprecated("")
@DeprecatedSinceKotlin(warningSince = "1.4")
class ClassCur
@@ -1,5 +1,7 @@
// !API_VERSION: 1.4
package kotlin
@Deprecated("")
@DeprecatedSinceKotlin(warningSince = "1.4")
class ClassCur
@@ -1,21 +1,23 @@
package
@kotlin.Deprecated(message = "") @kotlin.DeprecatedSinceKotlin(warningSince = "1.4") public val valCur: kotlin.Unit
@kotlin.Deprecated(message = "") @kotlin.DeprecatedSinceKotlin(warningSince = "1.5") public val valNext: kotlin.Unit
@kotlin.Deprecated(message = "") @kotlin.DeprecatedSinceKotlin(warningSince = "1.4") public fun funCur(): kotlin.Unit
@kotlin.Deprecated(message = "") @kotlin.DeprecatedSinceKotlin(warningSince = "1.5") public fun funNext(): kotlin.Unit
public fun usage(): kotlin.Unit
package kotlin {
@kotlin.Deprecated(message = "") @kotlin.DeprecatedSinceKotlin(warningSince = "1.4") public val valCur: kotlin.Unit
@kotlin.Deprecated(message = "") @kotlin.DeprecatedSinceKotlin(warningSince = "1.5") public val valNext: kotlin.Unit
@kotlin.Deprecated(message = "") @kotlin.DeprecatedSinceKotlin(warningSince = "1.4") public fun funCur(): kotlin.Unit
@kotlin.Deprecated(message = "") @kotlin.DeprecatedSinceKotlin(warningSince = "1.5") public fun funNext(): kotlin.Unit
public fun usage(): kotlin.Unit
@kotlin.Deprecated(message = "") @kotlin.DeprecatedSinceKotlin(warningSince = "1.4") public final class ClassCur {
public constructor ClassCur()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
@kotlin.Deprecated(message = "") @kotlin.DeprecatedSinceKotlin(warningSince = "1.4") public final class ClassCur {
public constructor ClassCur()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
@kotlin.Deprecated(message = "") @kotlin.DeprecatedSinceKotlin(warningSince = "1.5") public final class ClassNext {
public constructor ClassNext()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
@kotlin.Deprecated(message = "") @kotlin.DeprecatedSinceKotlin(warningSince = "1.5") public final class ClassNext {
public constructor ClassNext()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
}
@@ -1,11 +1,14 @@
@Suppress("DEPRECATED_SINCE_KOTLIN_OUTSIDE_KOTLIN_SUBPACKAGE")
@Deprecated("")
@DeprecatedSinceKotlin(warningSince = "1.0")
fun test1() {}
@Suppress("DEPRECATED_SINCE_KOTLIN_OUTSIDE_KOTLIN_SUBPACKAGE")
@Deprecated("")
@DeprecatedSinceKotlin(warningSince = "1.9")
fun test2() {}
@Suppress("DEPRECATED_SINCE_KOTLIN_OUTSIDE_KOTLIN_SUBPACKAGE")
@Deprecated("")
@DeprecatedSinceKotlin
fun test3() {}
@@ -6674,6 +6674,11 @@ public class DiagnosticsTestGenerated extends AbstractDiagnosticsTestWithFirVali
runTest("compiler/testData/diagnostics/tests/deprecated/deprecatedSinceKotlin/deprecatedSinceKotlinDeclaration.kt");
}
@TestMetadata("deprecatedSinceKotlinOutsideKotlinPackage.kt")
public void testDeprecatedSinceKotlinOutsideKotlinPackage() throws Exception {
runTest("compiler/testData/diagnostics/tests/deprecated/deprecatedSinceKotlin/deprecatedSinceKotlinOutsideKotlinPackage.kt");
}
@TestMetadata("deprecatedSinceKotlinWithoutArguments.kt")
public void testDeprecatedSinceKotlinWithoutArguments() throws Exception {
runTest("compiler/testData/diagnostics/tests/deprecated/deprecatedSinceKotlin/deprecatedSinceKotlinWithoutArguments.kt");
@@ -6669,6 +6669,11 @@ public class DiagnosticsUsingJavacTestGenerated extends AbstractDiagnosticsUsing
runTest("compiler/testData/diagnostics/tests/deprecated/deprecatedSinceKotlin/deprecatedSinceKotlinDeclaration.kt");
}
@TestMetadata("deprecatedSinceKotlinOutsideKotlinPackage.kt")
public void testDeprecatedSinceKotlinOutsideKotlinPackage() throws Exception {
runTest("compiler/testData/diagnostics/tests/deprecated/deprecatedSinceKotlin/deprecatedSinceKotlinOutsideKotlinPackage.kt");
}
@TestMetadata("deprecatedSinceKotlinWithoutArguments.kt")
public void testDeprecatedSinceKotlinWithoutArguments() throws Exception {
runTest("compiler/testData/diagnostics/tests/deprecated/deprecatedSinceKotlin/deprecatedSinceKotlinWithoutArguments.kt");
@@ -1,5 +1,6 @@
// "Replace with 'newFun()'" "true"
@Suppress("DEPRECATED_SINCE_KOTLIN_OUTSIDE_KOTLIN_SUBPACKAGE")
@Deprecated("", ReplaceWith("newFun()"))
@DeprecatedSinceKotlin(warningSince = "1.0")
fun oldFun() {
@@ -1,5 +1,6 @@
// "Replace with 'newFun()'" "true"
@Suppress("DEPRECATED_SINCE_KOTLIN_OUTSIDE_KOTLIN_SUBPACKAGE")
@Deprecated("", ReplaceWith("newFun()"))
@DeprecatedSinceKotlin(warningSince = "1.0")
fun oldFun() {