Add script flag to kotlin.Metadata
This will allow to distinguish compiled scripts from ordinary classes in the compiler, reflection, IDE, etc. #KT-13382 Fixed
This commit is contained in:
@@ -36,6 +36,7 @@ public final class JvmAnnotationNames {
|
||||
|
||||
public static final int METADATA_MULTIFILE_PARTS_INHERIT_FLAG = 1 << 0;
|
||||
public static final int METADATA_PRE_RELEASE_FLAG = 1 << 1;
|
||||
public static final int METADATA_SCRIPT_FLAG = 1 << 2;
|
||||
|
||||
public static final Name DEFAULT_ANNOTATION_MEMBER_NAME = Name.identifier("value");
|
||||
|
||||
|
||||
+3
@@ -71,5 +71,8 @@ class KotlinClassHeader(
|
||||
val isPreRelease: Boolean
|
||||
get() = (extraInt and JvmAnnotationNames.METADATA_PRE_RELEASE_FLAG) != 0
|
||||
|
||||
val isScript: Boolean
|
||||
get() = (extraInt and JvmAnnotationNames.METADATA_SCRIPT_FLAG) != 0
|
||||
|
||||
override fun toString() = "$kind version=$metadataVersion"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user