delegate use-site targeted annotations: parser, front-end, codegen with some tests #KT-10502 Fixed
This commit is contained in:
@@ -1,13 +1,23 @@
|
||||
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()
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user