Serialize descriptors for local/anonymous classes on JVM

Reflection needs this information to work for local classes and anonymous
objects
This commit is contained in:
Alexander Udalov
2015-02-14 03:27:05 +03:00
parent 98b554d995
commit 6ce8d6bd2e
34 changed files with 567 additions and 127 deletions
@@ -23,5 +23,18 @@ import java.lang.annotation.RetentionPolicy;
public @interface KotlinClass {
int abiVersion();
Kind kind();
String[] data();
enum Kind {
CLASS,
/**
* A class has this kind if and only if its first non-class container is not a package.
*/
LOCAL_CLASS,
ANONYMOUS_OBJECT,
}
}
@@ -25,8 +25,7 @@ public @interface KotlinSyntheticClass {
Kind kind();
// Inner classes of local classes have kind LOCAL_CLASS
public static enum Kind {
enum Kind {
PACKAGE_PART,
TRAIT_IMPL,
LOCAL_TRAIT_IMPL,
@@ -35,7 +34,5 @@ public @interface KotlinSyntheticClass {
CALLABLE_REFERENCE_WRAPPER,
LOCAL_FUNCTION,
ANONYMOUS_FUNCTION,
LOCAL_CLASS,
ANONYMOUS_OBJECT,
}
}