Create empty method for annotated properties w/o fields

There was no place in bytecode where annotations on properties without backing
fields could be stored to. Now they're written on a synthetic empty void method
with a special name ("propertyName$annotations").

(Annotations on properties cannot simply be written on getters in bytecode,
since a getter can have annotations of its own.)
This commit is contained in:
Alexander Udalov
2013-07-11 19:47:05 +04:00
parent 23378f0054
commit c853c9be03
5 changed files with 83 additions and 8 deletions
@@ -0,0 +1,6 @@
import java.lang.annotation.*
Retention(RetentionPolicy.RUNTIME) annotation class SomeAnnotation(val value: String)
[SomeAnnotation("OK")] val property: Int
get() = 42