Serialize/deserialize annotations on types

This commit is contained in:
Alexander Udalov
2015-04-09 21:12:08 +03:00
parent 88abcdbde5
commit 0732b78853
25 changed files with 420 additions and 128 deletions
@@ -0,0 +1,5 @@
package test
annotation class A
fun ([A] String).foo() {}
@@ -0,0 +1,7 @@
package test
internal fun [test.A()] kotlin.String.foo(): kotlin.Unit
internal final annotation class A : kotlin.Annotation {
/*primary*/ public constructor A()
}
@@ -0,0 +1,7 @@
package test
annotation class A
class SimpleTypeAnnotation {
fun foo(x: [A] IntRange): [A] Int = 42
}
@@ -0,0 +1,10 @@
package test
internal final annotation class A : kotlin.Annotation {
/*primary*/ public constructor A()
}
internal final class SimpleTypeAnnotation {
/*primary*/ public constructor SimpleTypeAnnotation()
internal final fun foo(/*0*/ x: [test.A()] kotlin.IntRange): [test.A()] kotlin.Int
}
@@ -0,0 +1,9 @@
// ALLOW_AST_ACCESS
package test
annotation class Ann(val x: String, val y: Double)
class TypeAnnotationWithArguments {
fun foo(param: [Ann("param", 3.14)] IntRange): [Ann("fun", 2.72)] Unit {}
}
@@ -0,0 +1,14 @@
package test
internal final annotation class Ann : kotlin.Annotation {
/*primary*/ public constructor Ann(/*0*/ x: kotlin.String, /*1*/ y: kotlin.Double)
internal final val x: kotlin.String
internal final fun <get-x>(): kotlin.String
internal final val y: kotlin.Double
internal final fun <get-y>(): kotlin.Double
}
internal final class TypeAnnotationWithArguments {
/*primary*/ public constructor TypeAnnotationWithArguments()
internal final fun foo(/*0*/ param: [test.Ann(x = "param": kotlin.String, y = 3.14.toDouble(): kotlin.Double)] kotlin.IntRange): [test.Ann(x = "fun": kotlin.String, y = 2.72.toDouble(): kotlin.Double)] kotlin.Unit
}