Disallowed @Deprecated for local variables and parameters

This commit is contained in:
Valentin Kipyatkov
2015-09-07 20:37:07 +03:00
parent 5d09edb3e6
commit 452cd49c5e
6 changed files with 12 additions and 7 deletions
+1 -1
View File
@@ -283,7 +283,7 @@ public interface Comparable</*0*/ in T> {
public abstract fun compareTo(/*0*/ other: T): kotlin.Int
}
@kotlin.annotation.Target(allowedTargets = {AnnotationTarget.CLASS, AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY, AnnotationTarget.ANNOTATION_CLASS, AnnotationTarget.CONSTRUCTOR, AnnotationTarget.PROPERTY_SETTER, AnnotationTarget.PROPERTY_GETTER, AnnotationTarget.LOCAL_VARIABLE, AnnotationTarget.VALUE_PARAMETER}) @kotlin.annotation.MustBeDocumented() @kotlin.annotation.annotation() public final class Deprecated : kotlin.Annotation {
@kotlin.annotation.Target(allowedTargets = {AnnotationTarget.CLASS, AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY, AnnotationTarget.ANNOTATION_CLASS, AnnotationTarget.CONSTRUCTOR, AnnotationTarget.PROPERTY_SETTER, AnnotationTarget.PROPERTY_GETTER}) @kotlin.annotation.MustBeDocumented() @kotlin.annotation.annotation() public final class Deprecated : kotlin.Annotation {
/*primary*/ public constructor Deprecated(/*0*/ value: kotlin.String, /*1*/ replaceWith: kotlin.ReplaceWith = ...)
public final val replaceWith: kotlin.ReplaceWith
public final fun <get-replaceWith>(): kotlin.ReplaceWith
+3 -1
View File
@@ -1,6 +1,8 @@
package test
enum class MyEnum(@param:Deprecated("") @property:Deprecated("") val ord: Int) {
annotation class AAA
enum class MyEnum(@param:AAA @property:Deprecated("") val ord: Int) {
ENTRY(239);
fun f(@java.lang.Deprecated p: Int) {
@@ -1,9 +1,13 @@
package test
@kotlin.annotation.annotation() public final class AAA : kotlin.Annotation {
public constructor AAA()
}
public final enum class MyEnum : kotlin.Enum<test.MyEnum> {
enum entry ENTRY
private constructor MyEnum(/*0*/ @kotlin.Deprecated(value = "") kotlin.Int)
private constructor MyEnum(/*0*/ @test.AAA() kotlin.Int)
@kotlin.Deprecated(value = "") public final val ord: kotlin.Int
protected final /*fake_override*/ fun clone(): kotlin.Any
public final /*fake_override*/ fun compareTo(/*0*/ test.MyEnum): kotlin.Int
+1 -2
View File
@@ -36,8 +36,7 @@ public annotation class data
* @property replaceWith if present, specifies a code fragment which should be used as a replacement for
* the deprecated API usage.
*/
@Target(CLASS, FUNCTION, PROPERTY, ANNOTATION_CLASS, CONSTRUCTOR, PROPERTY_SETTER, PROPERTY_GETTER,
LOCAL_VARIABLE, VALUE_PARAMETER)
@Target(CLASS, FUNCTION, PROPERTY, ANNOTATION_CLASS, CONSTRUCTOR, PROPERTY_SETTER, PROPERTY_GETTER)
@MustBeDocumented
public annotation class Deprecated(val value: String, val replaceWith: ReplaceWith = ReplaceWith(""))
@@ -6,5 +6,5 @@ package test
@dependency.A @dependency.B @dependency.C @kotlin.data public final class Annotations public constructor() {
@dependency.A @dependency.B @dependency.C @kotlin.inline public final val p: @dependency.B kotlin.Int /* compiled code */
@dependency.A @dependency.B @dependency.C @kotlin.inline public final fun f(@dependency.A @dependency.B @dependency.C @kotlin.Deprecated i: @dependency.A kotlin.Int): kotlin.Unit { /* compiled code */ }
@dependency.A @dependency.B @dependency.C @kotlin.inline public final fun f(@dependency.A @dependency.B @dependency.C i: @dependency.A kotlin.Int): kotlin.Unit { /* compiled code */ }
}
@@ -4,7 +4,7 @@ import dependency.*
data @A("a") @B(1) @C class Annotations {
inline @A("f") @B(2) @C fun f(@A("i") @B(3) @C @Deprecated("1") i: @A("int") Int) {
inline @A("f") @B(2) @C fun f(@A("i") @B(3) @C i: @A("int") Int) {
}
inline @A("p") @B(3) @C val p: @B(4) Int = 2