CFG: mark annotation arguments as "used as expressions" #KT-24596 Fixed
NB: only classes / function / properties annotations are considered here, not including local declarations and other annotations
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
private const val <caret>TAG = "Tagged"
|
||||
|
||||
annotation class InAnn(val value: String)
|
||||
|
||||
@InAnn(TAG) class AnnHolder
|
||||
|
||||
@InAnn(value = TAG) class AnotherAnnHolder
|
||||
|
||||
@InAnn("This is $TAG") class ComplexAnnHolder {
|
||||
@InAnn("That is $TAG") fun foo() {}
|
||||
}
|
||||
|
||||
@InAnn("This is also $TAG") fun bar() {}
|
||||
|
||||
fun baz(@InAnn("This is $TAG too") x: Int) {}
|
||||
|
||||
@Target(AnnotationTarget.EXPRESSION)
|
||||
@Retention(AnnotationRetention.SOURCE)
|
||||
annotation class ExprAnn(val value: String)
|
||||
|
||||
val inProperty = TAG
|
||||
|
||||
fun foo() {
|
||||
val x = @ExprAnn(TAG) inProperty
|
||||
}
|
||||
Reference in New Issue
Block a user