Prohibit using DeprecatedSinceKotlin outside kotlin subpackage
This commit is contained in:
+5
@@ -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);
|
||||
|
||||
|
||||
+1
@@ -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);
|
||||
|
||||
|
||||
+11
@@ -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(
|
||||
|
||||
+2
@@ -1,3 +1,5 @@
|
||||
package kotlin
|
||||
|
||||
@Deprecated("")
|
||||
@DeprecatedSinceKotlin("", errorSince = "1.0")
|
||||
fun test1() {}
|
||||
|
||||
+2
@@ -1,3 +1,5 @@
|
||||
package kotlin
|
||||
|
||||
@Deprecated("")
|
||||
@<!ILLEGAL_KOTLIN_VERSION_STRING_VALUE!>DeprecatedSinceKotlin<!>("", errorSince = "1.0")
|
||||
fun test1() {}
|
||||
|
||||
+7
-5
@@ -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
|
||||
}
|
||||
|
||||
+2
@@ -1,3 +1,5 @@
|
||||
package kotlin.sub
|
||||
|
||||
@Deprecated("", ReplaceWith(""))
|
||||
@DeprecatedSinceKotlin(warningSince = "1.0", errorSince = "1.1", hiddenSince = "1.2")
|
||||
fun good() {}
|
||||
|
||||
+2
@@ -1,3 +1,5 @@
|
||||
package kotlin.sub
|
||||
|
||||
@Deprecated("", ReplaceWith(""))
|
||||
@DeprecatedSinceKotlin(warningSince = "1.0", errorSince = "1.1", hiddenSince = "1.2")
|
||||
fun good() {}
|
||||
|
||||
+20
-15
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
package foo.bar
|
||||
|
||||
@Deprecated("")
|
||||
@DeprecatedSinceKotlin("1.3")
|
||||
fun test() {}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
package foo.bar
|
||||
|
||||
@Deprecated("")
|
||||
@<!DEPRECATED_SINCE_KOTLIN_OUTSIDE_KOTLIN_SUBPACKAGE!>DeprecatedSinceKotlin<!>("1.3")
|
||||
fun test() {}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
package
|
||||
|
||||
package foo {
|
||||
|
||||
package foo.bar {
|
||||
@kotlin.Deprecated(message = "") @kotlin.DeprecatedSinceKotlin(warningSince = "1.3") public fun test(): kotlin.Unit
|
||||
}
|
||||
}
|
||||
+2
@@ -1,3 +1,5 @@
|
||||
package kotlin
|
||||
|
||||
@Deprecated("")
|
||||
@DeprecatedSinceKotlin
|
||||
fun foo() {}
|
||||
|
||||
+2
@@ -1,3 +1,5 @@
|
||||
package kotlin
|
||||
|
||||
@Deprecated("")
|
||||
@<!DEPRECATED_SINCE_KOTLIN_WITHOUT_ARGUMENTS!>DeprecatedSinceKotlin<!>
|
||||
fun foo() {}
|
||||
|
||||
+4
-2
@@ -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
|
||||
}
|
||||
|
||||
+2
@@ -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
|
||||
|
||||
+18
-16
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
+2
@@ -1,5 +1,7 @@
|
||||
// !API_VERSION: 1.4
|
||||
|
||||
package kotlin
|
||||
|
||||
@Deprecated("")
|
||||
@DeprecatedSinceKotlin(hiddenSince = "1.4")
|
||||
class ClassCur
|
||||
|
||||
+2
@@ -1,5 +1,7 @@
|
||||
// !API_VERSION: 1.4
|
||||
|
||||
package kotlin
|
||||
|
||||
@Deprecated("")
|
||||
@DeprecatedSinceKotlin(hiddenSince = "1.4")
|
||||
class ClassCur
|
||||
|
||||
+18
-16
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
+2
@@ -1,3 +1,5 @@
|
||||
package kotlin
|
||||
|
||||
@Deprecated("foo test")
|
||||
@DeprecatedSinceKotlin(warningSince = "1.0")
|
||||
fun foo() {}
|
||||
|
||||
+2
@@ -1,3 +1,5 @@
|
||||
package kotlin
|
||||
|
||||
@Deprecated("foo test")
|
||||
@DeprecatedSinceKotlin(warningSince = "1.0")
|
||||
fun foo() {}
|
||||
|
||||
+4
-2
@@ -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
|
||||
}
|
||||
|
||||
+2
@@ -1,5 +1,7 @@
|
||||
// !API_VERSION: 1.4
|
||||
|
||||
package kotlin
|
||||
|
||||
@Deprecated("")
|
||||
@DeprecatedSinceKotlin(warningSince = "1.4")
|
||||
class ClassCur
|
||||
|
||||
+2
@@ -1,5 +1,7 @@
|
||||
// !API_VERSION: 1.4
|
||||
|
||||
package kotlin
|
||||
|
||||
@Deprecated("")
|
||||
@DeprecatedSinceKotlin(warningSince = "1.4")
|
||||
class ClassCur
|
||||
|
||||
+18
-16
@@ -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");
|
||||
|
||||
Generated
+5
@@ -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
@@ -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
@@ -1,5 +1,6 @@
|
||||
// "Replace with 'newFun()'" "true"
|
||||
|
||||
@Suppress("DEPRECATED_SINCE_KOTLIN_OUTSIDE_KOTLIN_SUBPACKAGE")
|
||||
@Deprecated("", ReplaceWith("newFun()"))
|
||||
@DeprecatedSinceKotlin(warningSince = "1.0")
|
||||
fun oldFun() {
|
||||
|
||||
Reference in New Issue
Block a user