default -> companion: replace all mentions of default and default object
This commit is contained in:
@@ -207,6 +207,6 @@ public class KotlinLightClassCoherenceTest extends KotlinAsJavaTestBase {
|
||||
}
|
||||
|
||||
public void testClassObject() throws Exception {
|
||||
doTest("test.WithClassObject." + SpecialNames.DEFAULT_NAME_FOR_DEFAULT_OBJECT.asString());
|
||||
doTest("test.WithClassObject." + SpecialNames.DEFAULT_NAME_FOR_COMPANION_OBJECT.asString());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -140,7 +140,7 @@ public abstract class KotlinLightClassStructureTest extends KotlinAsJavaTestBase
|
||||
}
|
||||
|
||||
public void testInClassObjectActual() throws Exception {
|
||||
checkMethodGenericParameter("test.PlatformStaticClass." + SpecialNames.DEFAULT_NAME_FOR_DEFAULT_OBJECT.asString(), "inClassObject", 0, "T");
|
||||
checkMethodGenericParameter("test.PlatformStaticClass." + SpecialNames.DEFAULT_NAME_FOR_COMPANION_OBJECT.asString(), "inClassObject", 0, "T");
|
||||
}
|
||||
|
||||
public void testInClass() throws Exception {
|
||||
|
||||
@@ -144,8 +144,8 @@ public class ClassGenTest extends CodegenTestCase {
|
||||
loadFile("classes/classObjectIsInnerClass.kt");
|
||||
GeneratedClassLoader loader = generateAndCreateClassLoader();
|
||||
Class<?> a = loader.loadClass("A");
|
||||
Class<?> defaultObject = loader.loadClass("A$" + SpecialNames.DEFAULT_NAME_FOR_DEFAULT_OBJECT.asString());
|
||||
assertSameElements(a.getDeclaredClasses(), defaultObject);
|
||||
assertEquals(a, defaultObject.getDeclaringClass());
|
||||
Class<?> companionObject = loader.loadClass("A$" + SpecialNames.DEFAULT_NAME_FOR_COMPANION_OBJECT.asString());
|
||||
assertSameElements(a.getDeclaredClasses(), companionObject);
|
||||
assertEquals(a, companionObject.getDeclaringClass());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,14 +44,14 @@ public class InnerClassInfoGenTest extends CodegenTestCase {
|
||||
public void testInnerClassInfo() {
|
||||
InnerClassAttribute innerB = new InnerClassAttribute("A$B", "A", "B", ACC_PUBLIC | ACC_STATIC | ACC_FINAL);
|
||||
InnerClassAttribute innerC = new InnerClassAttribute("A$B$C", "A$B", "C", ACC_PUBLIC | ACC_FINAL);
|
||||
String defaultObjectDefaultName = SpecialNames.DEFAULT_NAME_FOR_DEFAULT_OBJECT.asString();
|
||||
InnerClassAttribute innerADefaultObject = new InnerClassAttribute(
|
||||
"A$" + defaultObjectDefaultName, "A", defaultObjectDefaultName, ACC_PUBLIC | ACC_STATIC | ACC_FINAL);
|
||||
String companionObjectDefaultName = SpecialNames.DEFAULT_NAME_FOR_COMPANION_OBJECT.asString();
|
||||
InnerClassAttribute innerACompanionObject = new InnerClassAttribute(
|
||||
"A$" + companionObjectDefaultName, "A", companionObjectDefaultName, ACC_PUBLIC | ACC_STATIC | ACC_FINAL);
|
||||
|
||||
extractAndCompareInnerClasses("A", innerB, innerADefaultObject);
|
||||
extractAndCompareInnerClasses("A", innerB, innerACompanionObject);
|
||||
extractAndCompareInnerClasses("A$B", innerB, innerC);
|
||||
extractAndCompareInnerClasses("A$B$C", innerB, innerC);
|
||||
extractAndCompareInnerClasses("A$" + defaultObjectDefaultName, innerADefaultObject);
|
||||
extractAndCompareInnerClasses("A$" + companionObjectDefaultName, innerACompanionObject);
|
||||
}
|
||||
|
||||
public void testLocalClass() {
|
||||
|
||||
@@ -44,7 +44,7 @@ public class OuterClassGenTest extends CodegenTestCase {
|
||||
}
|
||||
|
||||
public void testClassObject() throws Exception {
|
||||
doTest("foo.Foo$" + SpecialNames.DEFAULT_NAME_FOR_DEFAULT_OBJECT.asString(), "outerClassInfo");
|
||||
doTest("foo.Foo$" + SpecialNames.DEFAULT_NAME_FOR_COMPANION_OBJECT.asString(), "outerClassInfo");
|
||||
}
|
||||
|
||||
public void testInnerClass() throws Exception {
|
||||
|
||||
@@ -248,7 +248,7 @@ public class PropertyGenTest extends CodegenTestCase {
|
||||
findDeclaredMethodByName(c, "getExtension");
|
||||
findDeclaredMethodByName(c, "setExtension");
|
||||
|
||||
findDeclaredMethodByName(initializedClassLoader.loadClass("C$" + SpecialNames.DEFAULT_NAME_FOR_DEFAULT_OBJECT.asString()), "getClassObjectVal");
|
||||
findDeclaredMethodByName(initializedClassLoader.loadClass("C$" + SpecialNames.DEFAULT_NAME_FOR_COMPANION_OBJECT.asString()), "getClassObjectVal");
|
||||
|
||||
assertNull("Property should not have a getter", findDeclaredMethodByNameOrNull(c, "getVarNoAccessors"));
|
||||
assertNull("Property should not have a setter", findDeclaredMethodByNameOrNull(c, "setVarNoAccessors"));
|
||||
|
||||
-1
@@ -48,7 +48,6 @@ import java.util.jar.JarEntry;
|
||||
import java.util.jar.JarFile;
|
||||
import java.util.zip.ZipOutputStream;
|
||||
|
||||
import static org.jetbrains.kotlin.resolve.DescriptorUtils.isNonDefaultObject;
|
||||
import static org.jetbrains.kotlin.resolve.DescriptorUtils.isObject;
|
||||
import static org.jetbrains.kotlin.test.util.RecursiveDescriptorComparator.validateAndCompareDescriptorWithFile;
|
||||
|
||||
|
||||
+5
-5
@@ -45,7 +45,7 @@ import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import static org.jetbrains.kotlin.resolve.DescriptorUtils.isNonDefaultObject;
|
||||
import static org.jetbrains.kotlin.resolve.DescriptorUtils.isNonCompanionObject;
|
||||
|
||||
public abstract class AbstractAnnotationDescriptorResolveTest extends JetLiteFixture {
|
||||
private static final DescriptorRenderer WITH_ANNOTATION_ARGUMENT_TYPES = new DescriptorRendererBuilder()
|
||||
@@ -77,9 +77,9 @@ public abstract class AbstractAnnotationDescriptorResolveTest extends JetLiteFix
|
||||
|
||||
ClassDescriptor myClass = getClassDescriptor(testPackage, "MyClass");
|
||||
checkDescriptor(expectedAnnotation, myClass);
|
||||
ClassDescriptor defaultObjectDescriptor = myClass.getDefaultObjectDescriptor();
|
||||
assert defaultObjectDescriptor != null : "Cannot find default object for class " + myClass.getName();
|
||||
checkDescriptor(expectedAnnotation, defaultObjectDescriptor);
|
||||
ClassDescriptor companionObjectDescriptor = myClass.getCompanionObjectDescriptor();
|
||||
assert companionObjectDescriptor != null : "Cannot find companion object for class " + myClass.getName();
|
||||
checkDescriptor(expectedAnnotation, companionObjectDescriptor);
|
||||
checkDescriptor(expectedAnnotation, getInnerClassDescriptor(myClass, "InnerClass"));
|
||||
|
||||
FunctionDescriptor foo = getFunctionDescriptor(myClass, "foo");
|
||||
@@ -230,7 +230,7 @@ public abstract class AbstractAnnotationDescriptorResolveTest extends JetLiteFix
|
||||
@NotNull
|
||||
private ClassDescriptor getLocalObjectDescriptor(@NotNull String name) {
|
||||
ClassDescriptor localClassDescriptor = getLocalClassDescriptor(name);
|
||||
if (isNonDefaultObject(localClassDescriptor)) {
|
||||
if (isNonCompanionObject(localClassDescriptor)) {
|
||||
return localClassDescriptor;
|
||||
}
|
||||
|
||||
|
||||
@@ -9283,23 +9283,23 @@ public final class DebugProtoBuf {
|
||||
*/
|
||||
int getFqName();
|
||||
|
||||
// optional int32 default_object_name = 4;
|
||||
// optional int32 companion_object_name = 4;
|
||||
/**
|
||||
* <code>optional int32 default_object_name = 4;</code>
|
||||
* <code>optional int32 companion_object_name = 4;</code>
|
||||
*
|
||||
* <pre>
|
||||
* If this field is present, it contains the name of default object.
|
||||
* If this field is present, it contains the name of companion object.
|
||||
* </pre>
|
||||
*/
|
||||
boolean hasDefaultObjectName();
|
||||
boolean hasCompanionObjectName();
|
||||
/**
|
||||
* <code>optional int32 default_object_name = 4;</code>
|
||||
* <code>optional int32 companion_object_name = 4;</code>
|
||||
*
|
||||
* <pre>
|
||||
* If this field is present, it contains the name of default object.
|
||||
* If this field is present, it contains the name of companion object.
|
||||
* </pre>
|
||||
*/
|
||||
int getDefaultObjectName();
|
||||
int getCompanionObjectName();
|
||||
|
||||
// repeated .org.jetbrains.kotlin.serialization.TypeParameter type_parameter = 5;
|
||||
/**
|
||||
@@ -9533,7 +9533,7 @@ public final class DebugProtoBuf {
|
||||
}
|
||||
case 32: {
|
||||
bitField0_ |= 0x00000004;
|
||||
defaultObjectName_ = input.readInt32();
|
||||
companionObjectName_ = input.readInt32();
|
||||
break;
|
||||
}
|
||||
case 42: {
|
||||
@@ -10460,28 +10460,28 @@ public final class DebugProtoBuf {
|
||||
return fqName_;
|
||||
}
|
||||
|
||||
// optional int32 default_object_name = 4;
|
||||
public static final int DEFAULT_OBJECT_NAME_FIELD_NUMBER = 4;
|
||||
private int defaultObjectName_;
|
||||
// optional int32 companion_object_name = 4;
|
||||
public static final int COMPANION_OBJECT_NAME_FIELD_NUMBER = 4;
|
||||
private int companionObjectName_;
|
||||
/**
|
||||
* <code>optional int32 default_object_name = 4;</code>
|
||||
* <code>optional int32 companion_object_name = 4;</code>
|
||||
*
|
||||
* <pre>
|
||||
* If this field is present, it contains the name of default object.
|
||||
* If this field is present, it contains the name of companion object.
|
||||
* </pre>
|
||||
*/
|
||||
public boolean hasDefaultObjectName() {
|
||||
public boolean hasCompanionObjectName() {
|
||||
return ((bitField0_ & 0x00000004) == 0x00000004);
|
||||
}
|
||||
/**
|
||||
* <code>optional int32 default_object_name = 4;</code>
|
||||
* <code>optional int32 companion_object_name = 4;</code>
|
||||
*
|
||||
* <pre>
|
||||
* If this field is present, it contains the name of default object.
|
||||
* If this field is present, it contains the name of companion object.
|
||||
* </pre>
|
||||
*/
|
||||
public int getDefaultObjectName() {
|
||||
return defaultObjectName_;
|
||||
public int getCompanionObjectName() {
|
||||
return companionObjectName_;
|
||||
}
|
||||
|
||||
// repeated .org.jetbrains.kotlin.serialization.TypeParameter type_parameter = 5;
|
||||
@@ -10726,7 +10726,7 @@ public final class DebugProtoBuf {
|
||||
private void initFields() {
|
||||
flags_ = 0;
|
||||
fqName_ = 0;
|
||||
defaultObjectName_ = 0;
|
||||
companionObjectName_ = 0;
|
||||
typeParameter_ = java.util.Collections.emptyList();
|
||||
supertype_ = java.util.Collections.emptyList();
|
||||
nestedClassName_ = java.util.Collections.emptyList();
|
||||
@@ -10795,7 +10795,7 @@ public final class DebugProtoBuf {
|
||||
output.writeInt32(3, fqName_);
|
||||
}
|
||||
if (((bitField0_ & 0x00000004) == 0x00000004)) {
|
||||
output.writeInt32(4, defaultObjectName_);
|
||||
output.writeInt32(4, companionObjectName_);
|
||||
}
|
||||
for (int i = 0; i < typeParameter_.size(); i++) {
|
||||
output.writeMessage(5, typeParameter_.get(i));
|
||||
@@ -10838,7 +10838,7 @@ public final class DebugProtoBuf {
|
||||
}
|
||||
if (((bitField0_ & 0x00000004) == 0x00000004)) {
|
||||
size += com.google.protobuf.CodedOutputStream
|
||||
.computeInt32Size(4, defaultObjectName_);
|
||||
.computeInt32Size(4, companionObjectName_);
|
||||
}
|
||||
for (int i = 0; i < typeParameter_.size(); i++) {
|
||||
size += com.google.protobuf.CodedOutputStream
|
||||
@@ -11004,7 +11004,7 @@ public final class DebugProtoBuf {
|
||||
bitField0_ = (bitField0_ & ~0x00000001);
|
||||
fqName_ = 0;
|
||||
bitField0_ = (bitField0_ & ~0x00000002);
|
||||
defaultObjectName_ = 0;
|
||||
companionObjectName_ = 0;
|
||||
bitField0_ = (bitField0_ & ~0x00000004);
|
||||
if (typeParameterBuilder_ == null) {
|
||||
typeParameter_ = java.util.Collections.emptyList();
|
||||
@@ -11079,7 +11079,7 @@ public final class DebugProtoBuf {
|
||||
if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
|
||||
to_bitField0_ |= 0x00000004;
|
||||
}
|
||||
result.defaultObjectName_ = defaultObjectName_;
|
||||
result.companionObjectName_ = companionObjectName_;
|
||||
if (typeParameterBuilder_ == null) {
|
||||
if (((bitField0_ & 0x00000008) == 0x00000008)) {
|
||||
typeParameter_ = java.util.Collections.unmodifiableList(typeParameter_);
|
||||
@@ -11156,8 +11156,8 @@ public final class DebugProtoBuf {
|
||||
if (other.hasFqName()) {
|
||||
setFqName(other.getFqName());
|
||||
}
|
||||
if (other.hasDefaultObjectName()) {
|
||||
setDefaultObjectName(other.getDefaultObjectName());
|
||||
if (other.hasCompanionObjectName()) {
|
||||
setCompanionObjectName(other.getCompanionObjectName());
|
||||
}
|
||||
if (typeParameterBuilder_ == null) {
|
||||
if (!other.typeParameter_.isEmpty()) {
|
||||
@@ -11454,51 +11454,51 @@ public final class DebugProtoBuf {
|
||||
return this;
|
||||
}
|
||||
|
||||
// optional int32 default_object_name = 4;
|
||||
private int defaultObjectName_ ;
|
||||
// optional int32 companion_object_name = 4;
|
||||
private int companionObjectName_ ;
|
||||
/**
|
||||
* <code>optional int32 default_object_name = 4;</code>
|
||||
* <code>optional int32 companion_object_name = 4;</code>
|
||||
*
|
||||
* <pre>
|
||||
* If this field is present, it contains the name of default object.
|
||||
* If this field is present, it contains the name of companion object.
|
||||
* </pre>
|
||||
*/
|
||||
public boolean hasDefaultObjectName() {
|
||||
public boolean hasCompanionObjectName() {
|
||||
return ((bitField0_ & 0x00000004) == 0x00000004);
|
||||
}
|
||||
/**
|
||||
* <code>optional int32 default_object_name = 4;</code>
|
||||
* <code>optional int32 companion_object_name = 4;</code>
|
||||
*
|
||||
* <pre>
|
||||
* If this field is present, it contains the name of default object.
|
||||
* If this field is present, it contains the name of companion object.
|
||||
* </pre>
|
||||
*/
|
||||
public int getDefaultObjectName() {
|
||||
return defaultObjectName_;
|
||||
public int getCompanionObjectName() {
|
||||
return companionObjectName_;
|
||||
}
|
||||
/**
|
||||
* <code>optional int32 default_object_name = 4;</code>
|
||||
* <code>optional int32 companion_object_name = 4;</code>
|
||||
*
|
||||
* <pre>
|
||||
* If this field is present, it contains the name of default object.
|
||||
* If this field is present, it contains the name of companion object.
|
||||
* </pre>
|
||||
*/
|
||||
public Builder setDefaultObjectName(int value) {
|
||||
public Builder setCompanionObjectName(int value) {
|
||||
bitField0_ |= 0x00000004;
|
||||
defaultObjectName_ = value;
|
||||
companionObjectName_ = value;
|
||||
onChanged();
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>optional int32 default_object_name = 4;</code>
|
||||
* <code>optional int32 companion_object_name = 4;</code>
|
||||
*
|
||||
* <pre>
|
||||
* If this field is present, it contains the name of default object.
|
||||
* If this field is present, it contains the name of companion object.
|
||||
* </pre>
|
||||
*/
|
||||
public Builder clearDefaultObjectName() {
|
||||
public Builder clearCompanionObjectName() {
|
||||
bitField0_ = (bitField0_ & ~0x00000004);
|
||||
defaultObjectName_ = 0;
|
||||
companionObjectName_ = 0;
|
||||
onChanged();
|
||||
return this;
|
||||
}
|
||||
@@ -16964,48 +16964,49 @@ public final class DebugProtoBuf {
|
||||
"brains.kotlin.serialization.TypeParamete" +
|
||||
"r.Variance:\003INV\022=\n\013upper_bound\030\005 \003(\0132(.o",
|
||||
"rg.jetbrains.kotlin.serialization.Type\"$" +
|
||||
"\n\010Variance\022\006\n\002IN\020\000\022\007\n\003OUT\020\001\022\007\n\003INV\020\002\"\257\005\n" +
|
||||
"\n\010Variance\022\006\n\002IN\020\000\022\007\n\003OUT\020\001\022\007\n\003INV\020\002\"\261\005\n" +
|
||||
"\005Class\022\020\n\005flags\030\001 \001(\005:\0010\022\017\n\007fq_name\030\003 \002(" +
|
||||
"\005\022\033\n\023default_object_name\030\004 \001(\005\022I\n\016type_p" +
|
||||
"arameter\030\005 \003(\01321.org.jetbrains.kotlin.se" +
|
||||
"rialization.TypeParameter\022;\n\tsupertype\030\006" +
|
||||
" \003(\0132(.org.jetbrains.kotlin.serializatio" +
|
||||
"n.Type\022\031\n\021nested_class_name\030\007 \003(\005\022<\n\006mem" +
|
||||
"ber\030\013 \003(\0132,.org.jetbrains.kotlin.seriali" +
|
||||
"zation.Callable\022\022\n\nenum_entry\030\014 \003(\005\022Y\n\023p",
|
||||
"rimary_constructor\030\r \001(\0132<.org.jetbrains" +
|
||||
".kotlin.serialization.Class.PrimaryConst" +
|
||||
"ructor\022K\n\025secondary_constructor\030\016 \003(\0132,." +
|
||||
"org.jetbrains.kotlin.serialization.Calla" +
|
||||
"ble\032P\n\022PrimaryConstructor\022:\n\004data\030\001 \001(\0132" +
|
||||
"\005\022\035\n\025companion_object_name\030\004 \001(\005\022I\n\016type" +
|
||||
"_parameter\030\005 \003(\01321.org.jetbrains.kotlin." +
|
||||
"serialization.TypeParameter\022;\n\tsupertype" +
|
||||
"\030\006 \003(\0132(.org.jetbrains.kotlin.serializat" +
|
||||
"ion.Type\022\031\n\021nested_class_name\030\007 \003(\005\022<\n\006m" +
|
||||
"ember\030\013 \003(\0132,.org.jetbrains.kotlin.seria" +
|
||||
"lization.Callable\022\022\n\nenum_entry\030\014 \003(\005\022Y\n",
|
||||
"\023primary_constructor\030\r \001(\0132<.org.jetbrai" +
|
||||
"ns.kotlin.serialization.Class.PrimaryCon" +
|
||||
"structor\022K\n\025secondary_constructor\030\016 \003(\0132" +
|
||||
",.org.jetbrains.kotlin.serialization.Cal" +
|
||||
"lable\"p\n\004Kind\022\t\n\005CLASS\020\000\022\t\n\005TRAIT\020\001\022\016\n\nE" +
|
||||
"NUM_CLASS\020\002\022\016\n\nENUM_ENTRY\020\003\022\024\n\020ANNOTATIO" +
|
||||
"N_CLASS\020\004\022\n\n\006OBJECT\020\005\022\020\n\014CLASS_OBJECT\020\006*" +
|
||||
"\005\010d\020\310\001\"N\n\007Package\022<\n\006member\030\001 \003(\0132,.org.",
|
||||
"jetbrains.kotlin.serialization.Callable*" +
|
||||
"\005\010d\020\310\001\"\300\005\n\010Callable\022\r\n\005flags\030\001 \001(\005\022\024\n\014ge" +
|
||||
"tter_flags\030\t \001(\005\022\024\n\014setter_flags\030\n \001(\005\022I" +
|
||||
"\n\016type_parameter\030\004 \003(\01321.org.jetbrains.k" +
|
||||
"otlin.serialization.TypeParameter\022?\n\rrec" +
|
||||
"eiver_type\030\005 \001(\0132(.org.jetbrains.kotlin." +
|
||||
"serialization.Type\022\014\n\004name\030\006 \002(\005\022T\n\017valu" +
|
||||
"e_parameter\030\007 \003(\0132;.org.jetbrains.kotlin" +
|
||||
".serialization.Callable.ValueParameter\022=" +
|
||||
"\n\013return_type\030\010 \002(\0132(.org.jetbrains.kotl",
|
||||
"in.serialization.Type\032\263\001\n\016ValueParameter" +
|
||||
"\022\r\n\005flags\030\001 \001(\005\022\014\n\004name\030\002 \002(\005\0226\n\004type\030\003 " +
|
||||
"\002(\0132(.org.jetbrains.kotlin.serialization" +
|
||||
".Type\022E\n\023vararg_element_type\030\004 \001(\0132(.org" +
|
||||
".jetbrains.kotlin.serialization.Type*\005\010d" +
|
||||
"\020\310\001\"Q\n\nMemberKind\022\017\n\013DECLARATION\020\000\022\021\n\rFA" +
|
||||
"KE_OVERRIDE\020\001\022\016\n\nDELEGATION\020\002\022\017\n\013SYNTHES" +
|
||||
"IZED\020\003\":\n\014CallableKind\022\007\n\003FUN\020\000\022\007\n\003VAL\020\001" +
|
||||
"\022\007\n\003VAR\020\002\022\017\n\013CONSTRUCTOR\020\003*\005\010d\020\310\001*-\n\010Mod" +
|
||||
"ality\022\t\n\005FINAL\020\000\022\010\n\004OPEN\020\001\022\014\n\010ABSTRACT\020\002",
|
||||
"*b\n\nVisibility\022\014\n\010INTERNAL\020\000\022\013\n\007PRIVATE\020" +
|
||||
"\001\022\r\n\tPROTECTED\020\002\022\n\n\006PUBLIC\020\003\022\023\n\017PRIVATE_" +
|
||||
"TO_THIS\020\004\022\t\n\005LOCAL\020\005B\022B\rDebugProtoBuf\210\001\000"
|
||||
"lable\032P\n\022PrimaryConstructor\022:\n\004data\030\001 \001(" +
|
||||
"\0132,.org.jetbrains.kotlin.serialization.C" +
|
||||
"allable\"p\n\004Kind\022\t\n\005CLASS\020\000\022\t\n\005TRAIT\020\001\022\016\n" +
|
||||
"\nENUM_CLASS\020\002\022\016\n\nENUM_ENTRY\020\003\022\024\n\020ANNOTAT" +
|
||||
"ION_CLASS\020\004\022\n\n\006OBJECT\020\005\022\020\n\014CLASS_OBJECT\020" +
|
||||
"\006*\005\010d\020\310\001\"N\n\007Package\022<\n\006member\030\001 \003(\0132,.or",
|
||||
"g.jetbrains.kotlin.serialization.Callabl" +
|
||||
"e*\005\010d\020\310\001\"\300\005\n\010Callable\022\r\n\005flags\030\001 \001(\005\022\024\n\014" +
|
||||
"getter_flags\030\t \001(\005\022\024\n\014setter_flags\030\n \001(\005" +
|
||||
"\022I\n\016type_parameter\030\004 \003(\01321.org.jetbrains" +
|
||||
".kotlin.serialization.TypeParameter\022?\n\rr" +
|
||||
"eceiver_type\030\005 \001(\0132(.org.jetbrains.kotli" +
|
||||
"n.serialization.Type\022\014\n\004name\030\006 \002(\005\022T\n\017va" +
|
||||
"lue_parameter\030\007 \003(\0132;.org.jetbrains.kotl" +
|
||||
"in.serialization.Callable.ValueParameter" +
|
||||
"\022=\n\013return_type\030\010 \002(\0132(.org.jetbrains.ko",
|
||||
"tlin.serialization.Type\032\263\001\n\016ValueParamet" +
|
||||
"er\022\r\n\005flags\030\001 \001(\005\022\014\n\004name\030\002 \002(\005\0226\n\004type\030" +
|
||||
"\003 \002(\0132(.org.jetbrains.kotlin.serializati" +
|
||||
"on.Type\022E\n\023vararg_element_type\030\004 \001(\0132(.o" +
|
||||
"rg.jetbrains.kotlin.serialization.Type*\005" +
|
||||
"\010d\020\310\001\"Q\n\nMemberKind\022\017\n\013DECLARATION\020\000\022\021\n\r" +
|
||||
"FAKE_OVERRIDE\020\001\022\016\n\nDELEGATION\020\002\022\017\n\013SYNTH" +
|
||||
"ESIZED\020\003\":\n\014CallableKind\022\007\n\003FUN\020\000\022\007\n\003VAL" +
|
||||
"\020\001\022\007\n\003VAR\020\002\022\017\n\013CONSTRUCTOR\020\003*\005\010d\020\310\001*-\n\010M" +
|
||||
"odality\022\t\n\005FINAL\020\000\022\010\n\004OPEN\020\001\022\014\n\010ABSTRACT",
|
||||
"\020\002*b\n\nVisibility\022\014\n\010INTERNAL\020\000\022\013\n\007PRIVAT" +
|
||||
"E\020\001\022\r\n\tPROTECTED\020\002\022\n\n\006PUBLIC\020\003\022\023\n\017PRIVAT" +
|
||||
"E_TO_THIS\020\004\022\t\n\005LOCAL\020\005B\022B\rDebugProtoBuf\210" +
|
||||
"\001\000"
|
||||
};
|
||||
com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
|
||||
new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() {
|
||||
@@ -17077,7 +17078,7 @@ public final class DebugProtoBuf {
|
||||
internal_static_org_jetbrains_kotlin_serialization_Class_fieldAccessorTable = new
|
||||
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
|
||||
internal_static_org_jetbrains_kotlin_serialization_Class_descriptor,
|
||||
new java.lang.String[] { "Flags", "FqName", "DefaultObjectName", "TypeParameter", "Supertype", "NestedClassName", "Member", "EnumEntry", "PrimaryConstructor", "SecondaryConstructor", });
|
||||
new java.lang.String[] { "Flags", "FqName", "CompanionObjectName", "TypeParameter", "Supertype", "NestedClassName", "Member", "EnumEntry", "PrimaryConstructor", "SecondaryConstructor", });
|
||||
internal_static_org_jetbrains_kotlin_serialization_Class_PrimaryConstructor_descriptor =
|
||||
internal_static_org_jetbrains_kotlin_serialization_Class_descriptor.getNestedTypes().get(0);
|
||||
internal_static_org_jetbrains_kotlin_serialization_Class_PrimaryConstructor_fieldAccessorTable = new
|
||||
|
||||
@@ -1762,7 +1762,7 @@ public final class DebugJvmProtoBuf {
|
||||
* <code>optional bool is_static_in_outer = 3 [default = false];</code>
|
||||
*
|
||||
* <pre>
|
||||
* True iff this field is a backing field for a default object and is really present as a static
|
||||
* True iff this field is a backing field for a companion object and is really present as a static
|
||||
* field in the outer class, not as an instance field here
|
||||
* </pre>
|
||||
*/
|
||||
@@ -1771,7 +1771,7 @@ public final class DebugJvmProtoBuf {
|
||||
* <code>optional bool is_static_in_outer = 3 [default = false];</code>
|
||||
*
|
||||
* <pre>
|
||||
* True iff this field is a backing field for a default object and is really present as a static
|
||||
* True iff this field is a backing field for a companion object and is really present as a static
|
||||
* field in the outer class, not as an instance field here
|
||||
* </pre>
|
||||
*/
|
||||
@@ -1936,7 +1936,7 @@ public final class DebugJvmProtoBuf {
|
||||
* <code>optional bool is_static_in_outer = 3 [default = false];</code>
|
||||
*
|
||||
* <pre>
|
||||
* True iff this field is a backing field for a default object and is really present as a static
|
||||
* True iff this field is a backing field for a companion object and is really present as a static
|
||||
* field in the outer class, not as an instance field here
|
||||
* </pre>
|
||||
*/
|
||||
@@ -1947,7 +1947,7 @@ public final class DebugJvmProtoBuf {
|
||||
* <code>optional bool is_static_in_outer = 3 [default = false];</code>
|
||||
*
|
||||
* <pre>
|
||||
* True iff this field is a backing field for a default object and is really present as a static
|
||||
* True iff this field is a backing field for a companion object and is really present as a static
|
||||
* field in the outer class, not as an instance field here
|
||||
* </pre>
|
||||
*/
|
||||
@@ -2397,7 +2397,7 @@ public final class DebugJvmProtoBuf {
|
||||
* <code>optional bool is_static_in_outer = 3 [default = false];</code>
|
||||
*
|
||||
* <pre>
|
||||
* True iff this field is a backing field for a default object and is really present as a static
|
||||
* True iff this field is a backing field for a companion object and is really present as a static
|
||||
* field in the outer class, not as an instance field here
|
||||
* </pre>
|
||||
*/
|
||||
@@ -2408,7 +2408,7 @@ public final class DebugJvmProtoBuf {
|
||||
* <code>optional bool is_static_in_outer = 3 [default = false];</code>
|
||||
*
|
||||
* <pre>
|
||||
* True iff this field is a backing field for a default object and is really present as a static
|
||||
* True iff this field is a backing field for a companion object and is really present as a static
|
||||
* field in the outer class, not as an instance field here
|
||||
* </pre>
|
||||
*/
|
||||
@@ -2419,7 +2419,7 @@ public final class DebugJvmProtoBuf {
|
||||
* <code>optional bool is_static_in_outer = 3 [default = false];</code>
|
||||
*
|
||||
* <pre>
|
||||
* True iff this field is a backing field for a default object and is really present as a static
|
||||
* True iff this field is a backing field for a companion object and is really present as a static
|
||||
* field in the outer class, not as an instance field here
|
||||
* </pre>
|
||||
*/
|
||||
@@ -2433,7 +2433,7 @@ public final class DebugJvmProtoBuf {
|
||||
* <code>optional bool is_static_in_outer = 3 [default = false];</code>
|
||||
*
|
||||
* <pre>
|
||||
* True iff this field is a backing field for a default object and is really present as a static
|
||||
* True iff this field is a backing field for a companion object and is really present as a static
|
||||
* field in the outer class, not as an instance field here
|
||||
* </pre>
|
||||
*/
|
||||
|
||||
@@ -263,9 +263,9 @@ public class DescriptorValidator {
|
||||
}
|
||||
}
|
||||
|
||||
ClassDescriptor defaultObjectDescriptor = descriptor.getDefaultObjectDescriptor();
|
||||
if (defaultObjectDescriptor != null && !defaultObjectDescriptor.isDefaultObject()) {
|
||||
report(collector, defaultObjectDescriptor, "Default object should be marked as such");
|
||||
ClassDescriptor companionObjectDescriptor = descriptor.getCompanionObjectDescriptor();
|
||||
if (companionObjectDescriptor != null && !companionObjectDescriptor.isCompanionObject()) {
|
||||
report(collector, companionObjectDescriptor, "Companion object should be marked as such");
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user