Minor, rename TRAIT -> INTERFACE, CLASS_OBJECT -> COMPANION_OBJECT

This commit is contained in:
Alexander Udalov
2015-09-16 18:39:20 +03:00
parent a0fb1a18e3
commit 7cc416ed12
8 changed files with 33 additions and 34 deletions
+2 -2
View File
@@ -171,12 +171,12 @@ message Class {
enum Kind {
// 3 bits
CLASS = 0;
TRAIT = 1;
INTERFACE = 1;
ENUM_CLASS = 2;
ENUM_ENTRY = 3;
ANNOTATION_CLASS = 4;
OBJECT = 5;
CLASS_OBJECT = 6;
COMPANION_OBJECT = 6;
}
/*
@@ -87,13 +87,13 @@ public class Flags {
}
private static ProtoBuf.Class.Kind classKind(ClassKind kind, boolean isCompanionObject) {
if (isCompanionObject) return ProtoBuf.Class.Kind.CLASS_OBJECT;
if (isCompanionObject) return ProtoBuf.Class.Kind.COMPANION_OBJECT;
switch (kind) {
case CLASS:
return ProtoBuf.Class.Kind.CLASS;
case INTERFACE:
return ProtoBuf.Class.Kind.TRAIT;
return ProtoBuf.Class.Kind.INTERFACE;
case ENUM_CLASS:
return ProtoBuf.Class.Kind.ENUM_CLASS;
case ENUM_ENTRY:
@@ -7937,9 +7937,9 @@ public final class ProtoBuf {
*/
CLASS(0, 0),
/**
* <code>TRAIT = 1;</code>
* <code>INTERFACE = 1;</code>
*/
TRAIT(1, 1),
INTERFACE(1, 1),
/**
* <code>ENUM_CLASS = 2;</code>
*/
@@ -7957,9 +7957,9 @@ public final class ProtoBuf {
*/
OBJECT(5, 5),
/**
* <code>CLASS_OBJECT = 6;</code>
* <code>COMPANION_OBJECT = 6;</code>
*/
CLASS_OBJECT(6, 6),
COMPANION_OBJECT(6, 6),
;
/**
@@ -7971,9 +7971,9 @@ public final class ProtoBuf {
*/
public static final int CLASS_VALUE = 0;
/**
* <code>TRAIT = 1;</code>
* <code>INTERFACE = 1;</code>
*/
public static final int TRAIT_VALUE = 1;
public static final int INTERFACE_VALUE = 1;
/**
* <code>ENUM_CLASS = 2;</code>
*/
@@ -7991,9 +7991,9 @@ public final class ProtoBuf {
*/
public static final int OBJECT_VALUE = 5;
/**
* <code>CLASS_OBJECT = 6;</code>
* <code>COMPANION_OBJECT = 6;</code>
*/
public static final int CLASS_OBJECT_VALUE = 6;
public static final int COMPANION_OBJECT_VALUE = 6;
public final int getNumber() { return value; }
@@ -8001,12 +8001,12 @@ public final class ProtoBuf {
public static Kind valueOf(int value) {
switch (value) {
case 0: return CLASS;
case 1: return TRAIT;
case 1: return INTERFACE;
case 2: return ENUM_CLASS;
case 3: return ENUM_ENTRY;
case 4: return ANNOTATION_CLASS;
case 5: return OBJECT;
case 6: return CLASS_OBJECT;
case 6: return COMPANION_OBJECT;
default: return null;
}
}
@@ -55,7 +55,7 @@ public class DeserializedClassDescriptor(
private val visibility = Deserialization.visibility(Flags.VISIBILITY.get(classProto.getFlags()))
private val kindFromProto = Flags.CLASS_KIND.get(classProto.getFlags())
private val kind = Deserialization.classKind(kindFromProto)
private val isCompanion = kindFromProto == ProtoBuf.Class.Kind.CLASS_OBJECT
private val isCompanion = kindFromProto == ProtoBuf.Class.Kind.COMPANION_OBJECT
private val isInner = Flags.INNER.get(classProto.getFlags())
val c = outerContext.childContext(this, classProto.getTypeParameterList(), nameResolver)
@@ -16,11 +16,11 @@
package org.jetbrains.kotlin.serialization.deserialization
import org.jetbrains.kotlin.serialization.ProtoBuf
import org.jetbrains.kotlin.descriptors.CallableMemberDescriptor
import org.jetbrains.kotlin.descriptors.ClassKind
import org.jetbrains.kotlin.descriptors.Modality
import org.jetbrains.kotlin.descriptors.Visibilities
import org.jetbrains.kotlin.descriptors.ClassKind
import org.jetbrains.kotlin.serialization.ProtoBuf
import org.jetbrains.kotlin.serialization.ProtoBuf.TypeParameter
import org.jetbrains.kotlin.types.Variance
@@ -54,11 +54,11 @@ object Deserialization {
@JvmStatic
fun classKind(kind: ProtoBuf.Class.Kind): ClassKind = when (kind) {
ProtoBuf.Class.Kind.CLASS -> ClassKind.CLASS
ProtoBuf.Class.Kind.TRAIT -> ClassKind.INTERFACE
ProtoBuf.Class.Kind.INTERFACE -> ClassKind.INTERFACE
ProtoBuf.Class.Kind.ENUM_CLASS -> ClassKind.ENUM_CLASS
ProtoBuf.Class.Kind.ENUM_ENTRY -> ClassKind.ENUM_ENTRY
ProtoBuf.Class.Kind.ANNOTATION_CLASS -> ClassKind.ANNOTATION_CLASS
ProtoBuf.Class.Kind.OBJECT, ProtoBuf.Class.Kind.CLASS_OBJECT -> ClassKind.OBJECT
ProtoBuf.Class.Kind.OBJECT, ProtoBuf.Class.Kind.COMPANION_OBJECT -> ClassKind.OBJECT
}
@JvmStatic