Add kotlinp, a tool to print Kotlin metadata in class/module files

At the moment, it's not published anywhere, but that may change soon

 #KT-23198
This commit is contained in:
Alexander Udalov
2018-03-09 14:40:47 +01:00
parent e4062f6447
commit 4b284a4890
34 changed files with 1687 additions and 0 deletions
+52
View File
@@ -0,0 +1,52 @@
import kotlin.reflect.KClass
@Target(AnnotationTarget.TYPE)
annotation class A(
val z: Boolean,
val c: Char,
val b: Byte,
val s: Short,
val i: Int,
val f: Float,
val j: Long,
val d: Double,
val za: BooleanArray,
val ca: CharArray,
val ba: ByteArray,
val sa: ShortArray,
val ia: IntArray,
val fa: FloatArray,
val ja: LongArray,
val da: DoubleArray,
val str: String,
val enum: AnnotationTarget,
val klass: KClass<*>,
val anno: B
)
annotation class B(val value: String)
class C {
fun typeAnnotation(): @A(
true,
'x',
1.toByte(),
42.toShort(),
42424242,
-2.72f,
239239239239239L,
3.14,
[true],
['\''],
[1.toByte()],
[42.toShort()],
[42424242],
[-2.72f],
[239239239239239L],
[3.14],
"aba\ncaba'\"\t\u0001\u0002\uA66E",
AnnotationTarget.CLASS,
C::class,
B(value = "aba\ncaba'\"\t\u0001\u0002\uA66E")
) Unit {}
}