Files
kotlin/compiler/testData/codegen/bytecodeListing/annotations/onProperties.kt
Alexander Udalov e2a42446ed Use getter names for $annotations methods in most codegen tests
This is needed to update master to 1.4, while still testing the latest
compiler by default. Also add one test on the old behavior.
2019-12-30 16:29:13 +01:00

26 lines
757 B
Kotlin
Vendored

// !LANGUAGE: +UseGetterNameForPropertyAnnotationsMethodOnJvm
import kotlin.reflect.KProperty
annotation class AnnProp
annotation class AnnField
annotation class AnnProp2
annotation class AnnGetter
annotation class AnnSetter
annotation class AnnParam
annotation class AnnDelegate
class CustomDelegate {
operator fun getValue(thisRef: Any?, prop: KProperty<*>): String = prop.name
}
public class A(@AnnParam @field:AnnField @property:AnnProp2 val x: Int, @param:AnnParam @get:AnnGetter @set:AnnSetter var y: Int) {
@AnnProp @field:AnnField @property:AnnProp2 @get:AnnGetter @set:AnnSetter @setparam:AnnParam
var p: Int = 0
@AnnProp @property:AnnProp2 @delegate:AnnDelegate @property:AnnDelegate
val s: String by CustomDelegate()
}