Binary or runtime repeatable annotations are not allowed for JVM. Some tests fixed accordingly.
This commit is contained in:
+1
-1
@@ -1,5 +1,5 @@
|
||||
target(AnnotationTarget.EXPRESSION)
|
||||
annotation(repeatable = true) class Ann(val x: Int = 1)
|
||||
annotation(repeatable = true, retention = AnnotationRetention.SOURCE) class Ann(val x: Int = 1)
|
||||
|
||||
inline fun bar(block: () -> Int): Int = block()
|
||||
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@ package
|
||||
kotlin.inline() internal fun bar(/*0*/ block: () -> kotlin.Int): kotlin.Int
|
||||
internal fun foo(): kotlin.Unit
|
||||
|
||||
kotlin.annotation.target(allowedTargets = {AnnotationTarget.EXPRESSION}) kotlin.annotation.annotation(repeatable = true) internal final class Ann : kotlin.Annotation {
|
||||
kotlin.annotation.target(allowedTargets = {AnnotationTarget.EXPRESSION}) kotlin.annotation.annotation(repeatable = true, retention = AnnotationRetention.SOURCE) internal final class Ann : kotlin.Annotation {
|
||||
public constructor Ann(/*0*/ x: kotlin.Int = ...)
|
||||
internal final val x: kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
target(AnnotationTarget.TYPE, AnnotationTarget.CLASSIFIER,
|
||||
AnnotationTarget.CONSTRUCTOR, AnnotationTarget.FUNCTION,
|
||||
AnnotationTarget.EXPRESSION, AnnotationTarget.PROPERTY)
|
||||
annotation(repeatable = true) class Ann(val x: Int = 6)
|
||||
annotation(repeatable = true, retention = AnnotationRetention.SOURCE) class Ann(val x: Int = 6)
|
||||
|
||||
@Ann(1) @Ann(2) @Ann(3) @private class A @Ann constructor() {
|
||||
@Ann(x = 5) fun foo() {
|
||||
|
||||
@@ -10,7 +10,7 @@ Ann(x = 1) Ann(x = 2) Ann(x = 3) private final class A {
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
kotlin.annotation.target(allowedTargets = {AnnotationTarget.TYPE, AnnotationTarget.CLASSIFIER, AnnotationTarget.CONSTRUCTOR, AnnotationTarget.FUNCTION, AnnotationTarget.EXPRESSION, AnnotationTarget.PROPERTY}) kotlin.annotation.annotation(repeatable = true) internal final class Ann : kotlin.Annotation {
|
||||
kotlin.annotation.target(allowedTargets = {AnnotationTarget.TYPE, AnnotationTarget.CLASSIFIER, AnnotationTarget.CONSTRUCTOR, AnnotationTarget.FUNCTION, AnnotationTarget.EXPRESSION, AnnotationTarget.PROPERTY}) kotlin.annotation.annotation(repeatable = true, retention = AnnotationRetention.SOURCE) internal final class Ann : kotlin.Annotation {
|
||||
public constructor Ann(/*0*/ x: kotlin.Int = ...)
|
||||
internal final val x: kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
|
||||
@@ -4,14 +4,18 @@ annotation(retention = AnnotationRetention.SOURCE, repeatable = true) class repa
|
||||
|
||||
annotation(repeatable = true, retention = AnnotationRetention.SOURCE) class repann2(val f: Boolean)
|
||||
|
||||
annotation(repeatable = true, retention = AnnotationRetention.BINARY) class binrepann
|
||||
|
||||
target(AnnotationTarget.EXPRESSION) annotation(repeatable = true) class repexpr
|
||||
|
||||
repann repann class DoubleAnnotated
|
||||
repann <!NON_SOURCE_REPEATED_ANNOTATION!>repann<!> class DoubleAnnotated
|
||||
|
||||
repann1(1) repann1(2) repann1(3) class TripleAnnotated
|
||||
|
||||
repann2(true) repann2(false) repann2(false) repann2(true) class FourTimesAnnotated
|
||||
|
||||
@repann @repann fun foo(@repann @repann x: Int): Int {
|
||||
@repexpr @repexpr return x
|
||||
binrepann <!NON_SOURCE_REPEATED_ANNOTATION!>binrepann<!> class BinaryAnnotated
|
||||
|
||||
@repann <!NON_SOURCE_REPEATED_ANNOTATION!>@repann<!> fun foo(@repann <!NON_SOURCE_REPEATED_ANNOTATION!>@repann<!> x: Int): Int {
|
||||
@repexpr <!NON_SOURCE_REPEATED_ANNOTATION!>@repexpr<!> return x
|
||||
}
|
||||
@@ -2,6 +2,13 @@ package
|
||||
|
||||
repann() repann() internal fun foo(/*0*/ repann() repann() x: kotlin.Int): kotlin.Int
|
||||
|
||||
binrepann() binrepann() internal final class BinaryAnnotated {
|
||||
public constructor BinaryAnnotated()
|
||||
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
|
||||
}
|
||||
|
||||
repann() repann() internal final class DoubleAnnotated {
|
||||
public constructor DoubleAnnotated()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
@@ -23,6 +30,13 @@ repann1(x = 1) repann1(x = 2) repann1(x = 3) internal final class TripleAnnotate
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
kotlin.annotation.annotation(repeatable = true, retention = AnnotationRetention.BINARY) internal final class binrepann : kotlin.Annotation {
|
||||
public constructor binrepann()
|
||||
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.annotation.annotation(repeatable = true) internal final class repann : kotlin.Annotation {
|
||||
public constructor repann()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
target(AnnotationTarget.EXPRESSION)
|
||||
annotation(repeatable = true) class Ann
|
||||
annotation(repeatable = true, retention = AnnotationRetention.SOURCE) class Ann
|
||||
|
||||
fun <T> bar(block: (T) -> Int) {}
|
||||
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@ package
|
||||
internal fun </*0*/ T> bar(/*0*/ block: (T) -> kotlin.Int): kotlin.Unit
|
||||
internal fun foo(): kotlin.Unit
|
||||
|
||||
kotlin.annotation.target(allowedTargets = {AnnotationTarget.EXPRESSION}) kotlin.annotation.annotation(repeatable = true) internal final class Ann : kotlin.Annotation {
|
||||
kotlin.annotation.target(allowedTargets = {AnnotationTarget.EXPRESSION}) kotlin.annotation.annotation(repeatable = true, retention = AnnotationRetention.SOURCE) internal final class Ann : kotlin.Annotation {
|
||||
public constructor Ann()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
|
||||
@@ -15,5 +15,6 @@ public @interface RepeatableAnnotations {
|
||||
|
||||
// FILE: RepeatableUse.kt
|
||||
|
||||
RepeatableAnnotation RepeatableAnnotation class My
|
||||
// Error should be gone when Java 8 Target will be available
|
||||
RepeatableAnnotation <!NON_SOURCE_REPEATED_ANNOTATION!>RepeatableAnnotation<!> class My
|
||||
|
||||
|
||||
+2
-1
@@ -16,6 +16,7 @@ public @interface RepeatableAnnotations {
|
||||
|
||||
// FILE: RepeatableUse.kt
|
||||
|
||||
RepeatableAnnotation RepeatableAnnotation class My
|
||||
// Error should be gone when Java 8 Target will be available
|
||||
RepeatableAnnotation <!NON_SOURCE_REPEATED_ANNOTATION!>RepeatableAnnotation<!> class My
|
||||
|
||||
|
||||
|
||||
compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameterMustBeConstant/array.kt
Vendored
+2
-2
@@ -1,4 +1,4 @@
|
||||
annotation(repeatable = true) class Ann(val i: IntArray)
|
||||
annotation(repeatable = true, retention = AnnotationRetention.SOURCE) class Ann(val i: IntArray)
|
||||
|
||||
Ann(intArrayOf(<!ANNOTATION_PARAMETER_MUST_BE_CONST!>i<!>))
|
||||
Ann(intArrayOf(i2))
|
||||
@@ -13,7 +13,7 @@ val i3 = foo()
|
||||
|
||||
fun foo(): Int = 1
|
||||
|
||||
annotation(repeatable = true) class AnnAnn(val i: Array<Ann>)
|
||||
annotation(repeatable = true, retention = AnnotationRetention.SOURCE) class AnnAnn(val i: Array<Ann>)
|
||||
AnnAnn(arrayOf(Ann(intArrayOf(1))))
|
||||
AnnAnn(arrayOf(<!ANNOTATION_PARAMETER_MUST_BE_CONST!>iAnn<!>))
|
||||
class TestAnn
|
||||
|
||||
+2
-2
@@ -6,7 +6,7 @@ internal val i3: kotlin.Int
|
||||
internal val iAnn: Ann
|
||||
internal fun foo(): kotlin.Int
|
||||
|
||||
kotlin.annotation.annotation(repeatable = true) internal final class Ann : kotlin.Annotation {
|
||||
kotlin.annotation.annotation(repeatable = true, retention = AnnotationRetention.SOURCE) internal final class Ann : kotlin.Annotation {
|
||||
public constructor Ann(/*0*/ i: kotlin.IntArray)
|
||||
internal final val i: kotlin.IntArray
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
@@ -14,7 +14,7 @@ kotlin.annotation.annotation(repeatable = true) internal final class Ann : kotli
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
kotlin.annotation.annotation(repeatable = true) internal final class AnnAnn : kotlin.Annotation {
|
||||
kotlin.annotation.annotation(repeatable = true, retention = AnnotationRetention.SOURCE) internal final class AnnAnn : kotlin.Annotation {
|
||||
public constructor AnnAnn(/*0*/ i: kotlin.Array<Ann>)
|
||||
internal final val i: kotlin.Array<Ann>
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
annotation(repeatable = true) class Ann(val i: Int)
|
||||
annotation(repeatable = true, retention = AnnotationRetention.SOURCE) class Ann(val i: Int)
|
||||
annotation class AnnIA(val ia: IntArray)
|
||||
annotation class AnnSA(val sa: Array<String>)
|
||||
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@ internal val ia: kotlin.IntArray
|
||||
internal val sa: kotlin.Array<kotlin.String>
|
||||
internal fun foo(): kotlin.Int
|
||||
|
||||
kotlin.annotation.annotation(repeatable = true) internal final class Ann : kotlin.Annotation {
|
||||
kotlin.annotation.annotation(repeatable = true, retention = AnnotationRetention.SOURCE) internal final class Ann : kotlin.Annotation {
|
||||
public constructor Ann(/*0*/ i: kotlin.Int)
|
||||
internal final val i: kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
annotation(repeatable = true) class Ann(vararg val i: Int)
|
||||
annotation(repeatable = true, retention = AnnotationRetention.SOURCE) class Ann(vararg val i: Int)
|
||||
|
||||
Ann(<!ANNOTATION_PARAMETER_MUST_BE_CONST!>i<!>)
|
||||
Ann(i2)
|
||||
@@ -16,7 +16,7 @@ val i3 = foo()
|
||||
|
||||
fun foo(): Int = 1
|
||||
|
||||
annotation(repeatable = true) class AnnAnn(vararg val i: Ann)
|
||||
annotation(repeatable = true, retention = AnnotationRetention.SOURCE) class AnnAnn(vararg val i: Ann)
|
||||
AnnAnn(*arrayOf(Ann(1)))
|
||||
AnnAnn(*arrayOf(<!ANNOTATION_PARAMETER_MUST_BE_CONST!>iAnn<!>))
|
||||
class TestAnn
|
||||
|
||||
+2
-2
@@ -6,7 +6,7 @@ internal val i3: kotlin.Int
|
||||
internal val iAnn: Ann
|
||||
internal fun foo(): kotlin.Int
|
||||
|
||||
kotlin.annotation.annotation(repeatable = true) internal final class Ann : kotlin.Annotation {
|
||||
kotlin.annotation.annotation(repeatable = true, retention = AnnotationRetention.SOURCE) internal final class Ann : kotlin.Annotation {
|
||||
public constructor Ann(/*0*/ vararg i: kotlin.Int /*kotlin.IntArray*/)
|
||||
internal final val i: kotlin.IntArray
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
@@ -14,7 +14,7 @@ kotlin.annotation.annotation(repeatable = true) internal final class Ann : kotli
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
kotlin.annotation.annotation(repeatable = true) internal final class AnnAnn : kotlin.Annotation {
|
||||
kotlin.annotation.annotation(repeatable = true, retention = AnnotationRetention.SOURCE) internal final class AnnAnn : kotlin.Annotation {
|
||||
public constructor AnnAnn(/*0*/ vararg i: Ann /*kotlin.Array<out Ann>*/)
|
||||
internal final val i: kotlin.Array<out Ann>
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
|
||||
Reference in New Issue
Block a user