Report EXPERIMENTAL_ANNOTATION_ON_WRONG_TARGET without explicit @Target
#KT-48349 Fixed
This commit is contained in:
committed by
TeamCityServer
parent
865fccdd29
commit
7b0e5927cb
Vendored
+25
@@ -0,0 +1,25 @@
|
||||
// !USE_EXPERIMENTAL: kotlin.RequiresOptIn
|
||||
|
||||
@RequiresOptIn
|
||||
annotation class SomeOptInMarker
|
||||
|
||||
@RequiresOptIn
|
||||
@Target(AnnotationTarget.VALUE_PARAMETER, AnnotationTarget.PROPERTY, AnnotationTarget.PROPERTY_GETTER, AnnotationTarget.LOCAL_VARIABLE)
|
||||
annotation class OtherOptInMarker
|
||||
|
||||
class IntWrapper(
|
||||
@SomeOptInMarker
|
||||
@OtherOptInMarker
|
||||
val value: Int
|
||||
) {
|
||||
val isEven: Boolean
|
||||
@SomeOptInMarker
|
||||
@OtherOptInMarker
|
||||
get() = (value % 2) == 0
|
||||
}
|
||||
|
||||
fun foo() {
|
||||
@SomeOptInMarker
|
||||
@OtherOptInMarker
|
||||
val value = 2
|
||||
}
|
||||
Vendored
+25
@@ -0,0 +1,25 @@
|
||||
// !USE_EXPERIMENTAL: kotlin.RequiresOptIn
|
||||
|
||||
@RequiresOptIn
|
||||
annotation class SomeOptInMarker
|
||||
|
||||
@RequiresOptIn
|
||||
@Target(AnnotationTarget.VALUE_PARAMETER, AnnotationTarget.PROPERTY, AnnotationTarget.PROPERTY_GETTER, AnnotationTarget.LOCAL_VARIABLE)
|
||||
annotation class OtherOptInMarker
|
||||
|
||||
class IntWrapper(
|
||||
<!EXPERIMENTAL_ANNOTATION_ON_WRONG_TARGET!>@SomeOptInMarker<!>
|
||||
<!EXPERIMENTAL_ANNOTATION_ON_WRONG_TARGET!>@OtherOptInMarker<!>
|
||||
val value: Int
|
||||
) {
|
||||
val isEven: Boolean
|
||||
<!EXPERIMENTAL_ANNOTATION_ON_WRONG_TARGET!>@SomeOptInMarker<!>
|
||||
<!EXPERIMENTAL_ANNOTATION_ON_WRONG_TARGET!>@OtherOptInMarker<!>
|
||||
get() = (value % 2) == 0
|
||||
}
|
||||
|
||||
fun foo() {
|
||||
<!EXPERIMENTAL_ANNOTATION_ON_WRONG_TARGET!>@SomeOptInMarker<!>
|
||||
<!EXPERIMENTAL_ANNOTATION_ON_WRONG_TARGET!>@OtherOptInMarker<!>
|
||||
val value = 2
|
||||
}
|
||||
Vendored
+26
@@ -0,0 +1,26 @@
|
||||
package
|
||||
|
||||
public fun foo(): kotlin.Unit
|
||||
|
||||
public final class IntWrapper {
|
||||
public constructor IntWrapper(/*0*/ @SomeOptInMarker @OtherOptInMarker value: kotlin.Int)
|
||||
@get:SomeOptInMarker @get:OtherOptInMarker public final val isEven: kotlin.Boolean
|
||||
public final val value: kotlin.Int
|
||||
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.RequiresOptIn @kotlin.annotation.Target(allowedTargets = {AnnotationTarget.VALUE_PARAMETER, AnnotationTarget.PROPERTY, AnnotationTarget.PROPERTY_GETTER, AnnotationTarget.LOCAL_VARIABLE}) public final annotation class OtherOptInMarker : kotlin.Annotation {
|
||||
public constructor OtherOptInMarker()
|
||||
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.RequiresOptIn public final annotation class SomeOptInMarker : kotlin.Annotation {
|
||||
public constructor SomeOptInMarker()
|
||||
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
|
||||
}
|
||||
Reference in New Issue
Block a user