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
|
||||
}
|
||||
Reference in New Issue
Block a user