Deserialize annotations on class object properties

Class object properties' backing fields are generated into static fields of the
containing class, not into fields of class object. For fields we now store the
flag which, if set, tells that this field should be looked for in the
containing class
This commit is contained in:
Alexander Udalov
2013-07-19 23:09:55 +04:00
committed by Pavel V. Talanov
parent 32c5624531
commit 19299daacd
17 changed files with 229 additions and 12 deletions
@@ -0,0 +1,9 @@
package test
annotation class Anno
class Class {
class object {
[Anno] var property: Int = 42
}
}
@@ -0,0 +1,16 @@
package test
internal final annotation class Anno : jet.Annotation {
/*primary*/ public constructor Anno()
}
internal final class Class {
/*primary*/ public constructor Class()
internal class object <class-object-for-Class> {
/*primary*/ private constructor <class-object-for-Class>()
test.Anno() internal final var property: jet.Int
internal final fun <get-property>(): jet.Int
internal final fun <set-property>(/*0*/ <set-?>: jet.Int): jet.Unit
}
}
@@ -0,0 +1,10 @@
package test
annotation class Anno
class Class {
class object {
[Anno] val property: Int
get() = 42
}
}
@@ -0,0 +1,15 @@
package test
internal final annotation class Anno : jet.Annotation {
/*primary*/ public constructor Anno()
}
internal final class Class {
/*primary*/ public constructor Class()
internal class object <class-object-for-Class> {
/*primary*/ private constructor <class-object-for-Class>()
test.Anno() internal final val property: jet.Int
internal final fun <get-property>(): jet.Int
}
}
@@ -0,0 +1,9 @@
package test
annotation class Anno
class Class {
Anno val x: Int by object {
fun get(thiz: Class, data: PropertyMetadata) = null!!
}
}
@@ -0,0 +1,11 @@
package test
internal final annotation class Anno : jet.Annotation {
/*primary*/ public constructor Anno()
}
internal final class Class {
/*primary*/ public constructor Class()
test.Anno() internal final val x: jet.Int
internal final fun <get-x>(): jet.Int
}
@@ -0,0 +1,7 @@
package test
annotation class Anno
Anno val x: Int by object {
fun get(thiz: Any?, data: PropertyMetadata) = null!!
}
@@ -0,0 +1,8 @@
package test
test.Anno() internal val x: jet.Int
internal fun <get-x>(): jet.Int
internal final annotation class Anno : jet.Annotation {
/*primary*/ public constructor Anno()
}