Support annotations on property accessors in JS/common metadata

#KT-14529 Fixed
This commit is contained in:
Alexander Udalov
2018-10-01 18:34:04 +02:00
parent d1e1e274d9
commit 1ee1d15b91
27 changed files with 443 additions and 106 deletions
@@ -522,6 +522,24 @@ open class ProtoCompareGenerated(val oldNameResolver: NameResolver, val newNameR
}
}
if (old.getExtensionCount(JsProtoBuf.propertyGetterAnnotation) != new.getExtensionCount(JsProtoBuf.propertyGetterAnnotation)) {
return false
}
else {
for(i in 0..old.getExtensionCount(JsProtoBuf.propertyGetterAnnotation) - 1) {
if (!checkEquals(old.getExtension(JsProtoBuf.propertyGetterAnnotation, i), new.getExtension(JsProtoBuf.propertyGetterAnnotation, i))) return false
}
}
if (old.getExtensionCount(JsProtoBuf.propertySetterAnnotation) != new.getExtensionCount(JsProtoBuf.propertySetterAnnotation)) {
return false
}
else {
for(i in 0..old.getExtensionCount(JsProtoBuf.propertySetterAnnotation) - 1) {
if (!checkEquals(old.getExtension(JsProtoBuf.propertySetterAnnotation, i), new.getExtension(JsProtoBuf.propertySetterAnnotation, i))) return false
}
}
if (old.hasExtension(JsProtoBuf.compileTimeValue) != new.hasExtension(JsProtoBuf.compileTimeValue)) return false
if (old.hasExtension(JsProtoBuf.compileTimeValue)) {
if (!checkEquals(old.getExtension(JsProtoBuf.compileTimeValue), new.getExtension(JsProtoBuf.compileTimeValue))) return false
@@ -551,6 +569,24 @@ open class ProtoCompareGenerated(val oldNameResolver: NameResolver, val newNameR
}
}
if (old.getExtensionCount(BuiltInsProtoBuf.propertyGetterAnnotation) != new.getExtensionCount(BuiltInsProtoBuf.propertyGetterAnnotation)) {
return false
}
else {
for(i in 0..old.getExtensionCount(BuiltInsProtoBuf.propertyGetterAnnotation) - 1) {
if (!checkEquals(old.getExtension(BuiltInsProtoBuf.propertyGetterAnnotation, i), new.getExtension(BuiltInsProtoBuf.propertyGetterAnnotation, i))) return false
}
}
if (old.getExtensionCount(BuiltInsProtoBuf.propertySetterAnnotation) != new.getExtensionCount(BuiltInsProtoBuf.propertySetterAnnotation)) {
return false
}
else {
for(i in 0..old.getExtensionCount(BuiltInsProtoBuf.propertySetterAnnotation) - 1) {
if (!checkEquals(old.getExtension(BuiltInsProtoBuf.propertySetterAnnotation, i), new.getExtension(BuiltInsProtoBuf.propertySetterAnnotation, i))) return false
}
}
if (old.hasExtension(BuiltInsProtoBuf.compileTimeValue) != new.hasExtension(BuiltInsProtoBuf.compileTimeValue)) return false
if (old.hasExtension(BuiltInsProtoBuf.compileTimeValue)) {
if (!checkEquals(old.getExtension(BuiltInsProtoBuf.compileTimeValue), new.getExtension(BuiltInsProtoBuf.compileTimeValue))) return false
@@ -1779,6 +1815,14 @@ fun ProtoBuf.Property.hashCode(stringIndexes: (Int) -> Int, fqNameIndexes: (Int)
hashCode = 31 * hashCode + getExtension(JsProtoBuf.propertyAnnotation, i).hashCode(stringIndexes, fqNameIndexes)
}
for(i in 0..getExtensionCount(JsProtoBuf.propertyGetterAnnotation) - 1) {
hashCode = 31 * hashCode + getExtension(JsProtoBuf.propertyGetterAnnotation, i).hashCode(stringIndexes, fqNameIndexes)
}
for(i in 0..getExtensionCount(JsProtoBuf.propertySetterAnnotation) - 1) {
hashCode = 31 * hashCode + getExtension(JsProtoBuf.propertySetterAnnotation, i).hashCode(stringIndexes, fqNameIndexes)
}
if (hasExtension(JsProtoBuf.compileTimeValue)) {
hashCode = 31 * hashCode + getExtension(JsProtoBuf.compileTimeValue).hashCode(stringIndexes, fqNameIndexes)
}
@@ -1799,6 +1843,14 @@ fun ProtoBuf.Property.hashCode(stringIndexes: (Int) -> Int, fqNameIndexes: (Int)
hashCode = 31 * hashCode + getExtension(BuiltInsProtoBuf.propertyAnnotation, i).hashCode(stringIndexes, fqNameIndexes)
}
for(i in 0..getExtensionCount(BuiltInsProtoBuf.propertyGetterAnnotation) - 1) {
hashCode = 31 * hashCode + getExtension(BuiltInsProtoBuf.propertyGetterAnnotation, i).hashCode(stringIndexes, fqNameIndexes)
}
for(i in 0..getExtensionCount(BuiltInsProtoBuf.propertySetterAnnotation) - 1) {
hashCode = 31 * hashCode + getExtension(BuiltInsProtoBuf.propertySetterAnnotation, i).hashCode(stringIndexes, fqNameIndexes)
}
if (hasExtension(BuiltInsProtoBuf.compileTimeValue)) {
hashCode = 31 * hashCode + getExtension(BuiltInsProtoBuf.compileTimeValue).hashCode(stringIndexes, fqNameIndexes)
}
@@ -12,6 +12,8 @@ public final class DebugBuiltInsProtoBuf {
registry.add(org.jetbrains.kotlin.metadata.builtins.DebugBuiltInsProtoBuf.constructorAnnotation);
registry.add(org.jetbrains.kotlin.metadata.builtins.DebugBuiltInsProtoBuf.functionAnnotation);
registry.add(org.jetbrains.kotlin.metadata.builtins.DebugBuiltInsProtoBuf.propertyAnnotation);
registry.add(org.jetbrains.kotlin.metadata.builtins.DebugBuiltInsProtoBuf.propertyGetterAnnotation);
registry.add(org.jetbrains.kotlin.metadata.builtins.DebugBuiltInsProtoBuf.propertySetterAnnotation);
registry.add(org.jetbrains.kotlin.metadata.builtins.DebugBuiltInsProtoBuf.compileTimeValue);
registry.add(org.jetbrains.kotlin.metadata.builtins.DebugBuiltInsProtoBuf.enumEntryAnnotation);
registry.add(org.jetbrains.kotlin.metadata.builtins.DebugBuiltInsProtoBuf.parameterAnnotation);
@@ -73,6 +75,28 @@ public final class DebugBuiltInsProtoBuf {
.newFileScopedGeneratedExtension(
org.jetbrains.kotlin.metadata.DebugProtoBuf.Annotation.class,
org.jetbrains.kotlin.metadata.DebugProtoBuf.Annotation.getDefaultInstance());
public static final int PROPERTY_GETTER_ANNOTATION_FIELD_NUMBER = 152;
/**
* <code>extend .org.jetbrains.kotlin.metadata.Property { ... }</code>
*/
public static final
org.jetbrains.kotlin.protobuf.GeneratedMessage.GeneratedExtension<
org.jetbrains.kotlin.metadata.DebugProtoBuf.Property,
java.util.List<org.jetbrains.kotlin.metadata.DebugProtoBuf.Annotation>> propertyGetterAnnotation = org.jetbrains.kotlin.protobuf.GeneratedMessage
.newFileScopedGeneratedExtension(
org.jetbrains.kotlin.metadata.DebugProtoBuf.Annotation.class,
org.jetbrains.kotlin.metadata.DebugProtoBuf.Annotation.getDefaultInstance());
public static final int PROPERTY_SETTER_ANNOTATION_FIELD_NUMBER = 153;
/**
* <code>extend .org.jetbrains.kotlin.metadata.Property { ... }</code>
*/
public static final
org.jetbrains.kotlin.protobuf.GeneratedMessage.GeneratedExtension<
org.jetbrains.kotlin.metadata.DebugProtoBuf.Property,
java.util.List<org.jetbrains.kotlin.metadata.DebugProtoBuf.Annotation>> propertySetterAnnotation = org.jetbrains.kotlin.protobuf.GeneratedMessage
.newFileScopedGeneratedExtension(
org.jetbrains.kotlin.metadata.DebugProtoBuf.Annotation.class,
org.jetbrains.kotlin.metadata.DebugProtoBuf.Annotation.getDefaultInstance());
public static final int COMPILE_TIME_VALUE_FIELD_NUMBER = 151;
/**
* <code>extend .org.jetbrains.kotlin.metadata.Property { ... }</code>
@@ -153,22 +177,28 @@ public final class DebugBuiltInsProtoBuf {
"notation:p\n\023property_annotation\022\'.org.je" +
"tbrains.kotlin.metadata.Property\030\226\001 \003(\0132" +
").org.jetbrains.kotlin.metadata.Annotati" +
"on:~\n\022compile_time_value\022\'.org.jetbrains" +
".kotlin.metadata.Property\030\227\001 \001(\01328.org.j" +
"etbrains.kotlin.metadata.Annotation.Argu" +
"ment.Value:s\n\025enum_entry_annotation\022(.or",
"g.jetbrains.kotlin.metadata.EnumEntry\030\226\001" +
" \003(\0132).org.jetbrains.kotlin.metadata.Ann" +
"otation:w\n\024parameter_annotation\022-.org.je" +
"tbrains.kotlin.metadata.ValueParameter\030\226" +
"\001 \003(\0132).org.jetbrains.kotlin.metadata.An" +
"notation:h\n\017type_annotation\022#.org.jetbra" +
"ins.kotlin.metadata.Type\030\226\001 \003(\0132).org.je" +
"tbrains.kotlin.metadata.Annotation:{\n\031ty" +
"pe_parameter_annotation\022,.org.jetbrains." +
"kotlin.metadata.TypeParameter\030\226\001 \003(\0132).o",
"rg.jetbrains.kotlin.metadata.AnnotationB" +
"\027B\025DebugBuiltInsProtoBuf"
"on:w\n\032property_getter_annotation\022\'.org.j" +
"etbrains.kotlin.metadata.Property\030\230\001 \003(\013" +
"2).org.jetbrains.kotlin.metadata.Annotat" +
"ion:w\n\032property_setter_annotation\022\'.org.",
"jetbrains.kotlin.metadata.Property\030\231\001 \003(" +
"\0132).org.jetbrains.kotlin.metadata.Annota" +
"tion:~\n\022compile_time_value\022\'.org.jetbrai" +
"ns.kotlin.metadata.Property\030\227\001 \001(\01328.org" +
".jetbrains.kotlin.metadata.Annotation.Ar" +
"gument.Value:s\n\025enum_entry_annotation\022(." +
"org.jetbrains.kotlin.metadata.EnumEntry\030" +
"\226\001 \003(\0132).org.jetbrains.kotlin.metadata.A" +
"nnotation:w\n\024parameter_annotation\022-.org." +
"jetbrains.kotlin.metadata.ValueParameter",
"\030\226\001 \003(\0132).org.jetbrains.kotlin.metadata." +
"Annotation:h\n\017type_annotation\022#.org.jetb" +
"rains.kotlin.metadata.Type\030\226\001 \003(\0132).org." +
"jetbrains.kotlin.metadata.Annotation:{\n\031" +
"type_parameter_annotation\022,.org.jetbrain" +
"s.kotlin.metadata.TypeParameter\030\226\001 \003(\0132)" +
".org.jetbrains.kotlin.metadata.Annotatio" +
"nB\027B\025DebugBuiltInsProtoBuf"
};
org.jetbrains.kotlin.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
new org.jetbrains.kotlin.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() {
@@ -188,11 +218,13 @@ public final class DebugBuiltInsProtoBuf {
constructorAnnotation.internalInit(descriptor.getExtensions().get(2));
functionAnnotation.internalInit(descriptor.getExtensions().get(3));
propertyAnnotation.internalInit(descriptor.getExtensions().get(4));
compileTimeValue.internalInit(descriptor.getExtensions().get(5));
enumEntryAnnotation.internalInit(descriptor.getExtensions().get(6));
parameterAnnotation.internalInit(descriptor.getExtensions().get(7));
typeAnnotation.internalInit(descriptor.getExtensions().get(8));
typeParameterAnnotation.internalInit(descriptor.getExtensions().get(9));
propertyGetterAnnotation.internalInit(descriptor.getExtensions().get(5));
propertySetterAnnotation.internalInit(descriptor.getExtensions().get(6));
compileTimeValue.internalInit(descriptor.getExtensions().get(7));
enumEntryAnnotation.internalInit(descriptor.getExtensions().get(8));
parameterAnnotation.internalInit(descriptor.getExtensions().get(9));
typeAnnotation.internalInit(descriptor.getExtensions().get(10));
typeParameterAnnotation.internalInit(descriptor.getExtensions().get(11));
org.jetbrains.kotlin.metadata.DebugProtoBuf.getDescriptor();
}
@@ -14,6 +14,8 @@ public final class DebugJsProtoBuf {
registry.add(org.jetbrains.kotlin.metadata.js.DebugJsProtoBuf.functionAnnotation);
registry.add(org.jetbrains.kotlin.metadata.js.DebugJsProtoBuf.functionContainingFileId);
registry.add(org.jetbrains.kotlin.metadata.js.DebugJsProtoBuf.propertyAnnotation);
registry.add(org.jetbrains.kotlin.metadata.js.DebugJsProtoBuf.propertyGetterAnnotation);
registry.add(org.jetbrains.kotlin.metadata.js.DebugJsProtoBuf.propertySetterAnnotation);
registry.add(org.jetbrains.kotlin.metadata.js.DebugJsProtoBuf.compileTimeValue);
registry.add(org.jetbrains.kotlin.metadata.js.DebugJsProtoBuf.propertyContainingFileId);
registry.add(org.jetbrains.kotlin.metadata.js.DebugJsProtoBuf.enumEntryAnnotation);
@@ -4752,6 +4754,28 @@ public final class DebugJsProtoBuf {
.newFileScopedGeneratedExtension(
org.jetbrains.kotlin.metadata.DebugProtoBuf.Annotation.class,
org.jetbrains.kotlin.metadata.DebugProtoBuf.Annotation.getDefaultInstance());
public static final int PROPERTY_GETTER_ANNOTATION_FIELD_NUMBER = 132;
/**
* <code>extend .org.jetbrains.kotlin.metadata.Property { ... }</code>
*/
public static final
org.jetbrains.kotlin.protobuf.GeneratedMessage.GeneratedExtension<
org.jetbrains.kotlin.metadata.DebugProtoBuf.Property,
java.util.List<org.jetbrains.kotlin.metadata.DebugProtoBuf.Annotation>> propertyGetterAnnotation = org.jetbrains.kotlin.protobuf.GeneratedMessage
.newFileScopedGeneratedExtension(
org.jetbrains.kotlin.metadata.DebugProtoBuf.Annotation.class,
org.jetbrains.kotlin.metadata.DebugProtoBuf.Annotation.getDefaultInstance());
public static final int PROPERTY_SETTER_ANNOTATION_FIELD_NUMBER = 133;
/**
* <code>extend .org.jetbrains.kotlin.metadata.Property { ... }</code>
*/
public static final
org.jetbrains.kotlin.protobuf.GeneratedMessage.GeneratedExtension<
org.jetbrains.kotlin.metadata.DebugProtoBuf.Property,
java.util.List<org.jetbrains.kotlin.metadata.DebugProtoBuf.Annotation>> propertySetterAnnotation = org.jetbrains.kotlin.protobuf.GeneratedMessage
.newFileScopedGeneratedExtension(
org.jetbrains.kotlin.metadata.DebugProtoBuf.Annotation.class,
org.jetbrains.kotlin.metadata.DebugProtoBuf.Annotation.getDefaultInstance());
public static final int COMPILE_TIME_VALUE_FIELD_NUMBER = 131;
/**
* <code>extend .org.jetbrains.kotlin.metadata.Property { ... }</code>
@@ -4900,27 +4924,33 @@ public final class DebugJsProtoBuf {
"ion\030\207\001 \001(\005:p\n\023property_annotation\022\'.org." +
"jetbrains.kotlin.metadata.Property\030\202\001 \003(" +
"\0132).org.jetbrains.kotlin.metadata.Annota" +
"tion:~\n\022compile_time_value\022\'.org.jetbrai" +
"ns.kotlin.metadata.Property\030\203\001 \001(\01328.org" +
".jetbrains.kotlin.metadata.Annotation.Ar",
"gument.Value:M\n\033property_containing_file" +
"_id\022\'.org.jetbrains.kotlin.metadata.Prop" +
"erty\030\207\001 \001(\005:s\n\025enum_entry_annotation\022(.o" +
"rg.jetbrains.kotlin.metadata.EnumEntry\030\202" +
"\001 \003(\0132).org.jetbrains.kotlin.metadata.An" +
"notation:w\n\024parameter_annotation\022-.org.j" +
"etbrains.kotlin.metadata.ValueParameter\030" +
"\202\001 \003(\0132).org.jetbrains.kotlin.metadata.A" +
"nnotation:h\n\017type_annotation\022#.org.jetbr" +
"ains.kotlin.metadata.Type\030\202\001 \003(\0132).org.j",
"etbrains.kotlin.metadata.Annotation:{\n\031t" +
"ype_parameter_annotation\022,.org.jetbrains" +
".kotlin.metadata.TypeParameter\030\202\001 \003(\0132)." +
"org.jetbrains.kotlin.metadata.Annotation" +
":x\n\026package_fragment_files\022..org.jetbrai" +
"ns.kotlin.metadata.PackageFragment\030\202\001 \001(" +
"\0132\'.org.jetbrains.kotlin.metadata.js.Fil" +
"esB\021B\017DebugJsProtoBuf"
"tion:w\n\032property_getter_annotation\022\'.org" +
".jetbrains.kotlin.metadata.Property\030\204\001 \003" +
"(\0132).org.jetbrains.kotlin.metadata.Annot",
"ation:w\n\032property_setter_annotation\022\'.or" +
"g.jetbrains.kotlin.metadata.Property\030\205\001 " +
"\003(\0132).org.jetbrains.kotlin.metadata.Anno" +
"tation:~\n\022compile_time_value\022\'.org.jetbr" +
"ains.kotlin.metadata.Property\030\203\001 \001(\01328.o" +
"rg.jetbrains.kotlin.metadata.Annotation." +
"Argument.Value:M\n\033property_containing_fi" +
"le_id\022\'.org.jetbrains.kotlin.metadata.Pr" +
"operty\030\207\001 \001(\005:s\n\025enum_entry_annotation\022(" +
".org.jetbrains.kotlin.metadata.EnumEntry",
"\030\202\001 \003(\0132).org.jetbrains.kotlin.metadata." +
"Annotation:w\n\024parameter_annotation\022-.org" +
".jetbrains.kotlin.metadata.ValueParamete" +
"r\030\202\001 \003(\0132).org.jetbrains.kotlin.metadata" +
".Annotation:h\n\017type_annotation\022#.org.jet" +
"brains.kotlin.metadata.Type\030\202\001 \003(\0132).org" +
".jetbrains.kotlin.metadata.Annotation:{\n" +
"\031type_parameter_annotation\022,.org.jetbrai" +
"ns.kotlin.metadata.TypeParameter\030\202\001 \003(\0132" +
").org.jetbrains.kotlin.metadata.Annotati",
"on:x\n\026package_fragment_files\022..org.jetbr" +
"ains.kotlin.metadata.PackageFragment\030\202\001 " +
"\001(\0132\'.org.jetbrains.kotlin.metadata.js.F" +
"ilesB\021B\017DebugJsProtoBuf"
};
org.jetbrains.kotlin.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
new org.jetbrains.kotlin.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() {
@@ -4972,13 +5002,15 @@ public final class DebugJsProtoBuf {
functionAnnotation.internalInit(descriptor.getExtensions().get(4));
functionContainingFileId.internalInit(descriptor.getExtensions().get(5));
propertyAnnotation.internalInit(descriptor.getExtensions().get(6));
compileTimeValue.internalInit(descriptor.getExtensions().get(7));
propertyContainingFileId.internalInit(descriptor.getExtensions().get(8));
enumEntryAnnotation.internalInit(descriptor.getExtensions().get(9));
parameterAnnotation.internalInit(descriptor.getExtensions().get(10));
typeAnnotation.internalInit(descriptor.getExtensions().get(11));
typeParameterAnnotation.internalInit(descriptor.getExtensions().get(12));
packageFragmentFiles.internalInit(descriptor.getExtensions().get(13));
propertyGetterAnnotation.internalInit(descriptor.getExtensions().get(7));
propertySetterAnnotation.internalInit(descriptor.getExtensions().get(8));
compileTimeValue.internalInit(descriptor.getExtensions().get(9));
propertyContainingFileId.internalInit(descriptor.getExtensions().get(10));
enumEntryAnnotation.internalInit(descriptor.getExtensions().get(11));
parameterAnnotation.internalInit(descriptor.getExtensions().get(12));
typeAnnotation.internalInit(descriptor.getExtensions().get(13));
typeParameterAnnotation.internalInit(descriptor.getExtensions().get(14));
packageFragmentFiles.internalInit(descriptor.getExtensions().get(15));
org.jetbrains.kotlin.metadata.DebugProtoBuf.getDescriptor();
}
@@ -14,6 +14,8 @@ public final class DebugKonanProtoBuf {
registry.add(org.jetbrains.kotlin.metadata.konan.DebugKonanProtoBuf.functionAnnotation);
registry.add(org.jetbrains.kotlin.metadata.konan.DebugKonanProtoBuf.inlineIrBody);
registry.add(org.jetbrains.kotlin.metadata.konan.DebugKonanProtoBuf.propertyAnnotation);
registry.add(org.jetbrains.kotlin.metadata.konan.DebugKonanProtoBuf.propertyGetterAnnotation);
registry.add(org.jetbrains.kotlin.metadata.konan.DebugKonanProtoBuf.propertySetterAnnotation);
registry.add(org.jetbrains.kotlin.metadata.konan.DebugKonanProtoBuf.hasBackingField);
registry.add(org.jetbrains.kotlin.metadata.konan.DebugKonanProtoBuf.usedAsVariable);
registry.add(org.jetbrains.kotlin.metadata.konan.DebugKonanProtoBuf.compileTimeValue);
@@ -3930,6 +3932,28 @@ public final class DebugKonanProtoBuf {
.newFileScopedGeneratedExtension(
org.jetbrains.kotlin.metadata.DebugProtoBuf.Annotation.class,
org.jetbrains.kotlin.metadata.DebugProtoBuf.Annotation.getDefaultInstance());
public static final int PROPERTY_GETTER_ANNOTATION_FIELD_NUMBER = 176;
/**
* <code>extend .org.jetbrains.kotlin.metadata.Property { ... }</code>
*/
public static final
org.jetbrains.kotlin.protobuf.GeneratedMessage.GeneratedExtension<
org.jetbrains.kotlin.metadata.DebugProtoBuf.Property,
java.util.List<org.jetbrains.kotlin.metadata.DebugProtoBuf.Annotation>> propertyGetterAnnotation = org.jetbrains.kotlin.protobuf.GeneratedMessage
.newFileScopedGeneratedExtension(
org.jetbrains.kotlin.metadata.DebugProtoBuf.Annotation.class,
org.jetbrains.kotlin.metadata.DebugProtoBuf.Annotation.getDefaultInstance());
public static final int PROPERTY_SETTER_ANNOTATION_FIELD_NUMBER = 177;
/**
* <code>extend .org.jetbrains.kotlin.metadata.Property { ... }</code>
*/
public static final
org.jetbrains.kotlin.protobuf.GeneratedMessage.GeneratedExtension<
org.jetbrains.kotlin.metadata.DebugProtoBuf.Property,
java.util.List<org.jetbrains.kotlin.metadata.DebugProtoBuf.Annotation>> propertySetterAnnotation = org.jetbrains.kotlin.protobuf.GeneratedMessage
.newFileScopedGeneratedExtension(
org.jetbrains.kotlin.metadata.DebugProtoBuf.Annotation.class,
org.jetbrains.kotlin.metadata.DebugProtoBuf.Annotation.getDefaultInstance());
public static final int HAS_BACKING_FIELD_FIELD_NUMBER = 171;
/**
* <code>extend .org.jetbrains.kotlin.metadata.Property { ... }</code>
@@ -4120,35 +4144,41 @@ public final class DebugKonanProtoBuf {
"nlineIrBody:p\n\023property_annotation\022\'.org" +
".jetbrains.kotlin.metadata.Property\030\252\001 \003" +
"(\0132).org.jetbrains.kotlin.metadata.Annot" +
"ation:C\n\021has_backing_field\022\'.org.jetbrai" +
"ns.kotlin.metadata.Property\030\253\001 \001(\010:B\n\020us" +
"ed_as_variable\022\'.org.jetbrains.kotlin.me" +
"tadata.Property\030\254\001 \001(\010:~\n\022compile_time_v",
"alue\022\'.org.jetbrains.kotlin.metadata.Pro" +
"perty\030\255\001 \001(\01328.org.jetbrains.kotlin.meta" +
"data.Annotation.Argument.Value:z\n\025inline" +
"_getter_ir_body\022\'.org.jetbrains.kotlin.m" +
"etadata.Property\030\256\001 \001(\01321.org.jetbrains." +
"kotlin.metadata.konan.InlineIrBody:z\n\025in" +
"line_setter_ir_body\022\'.org.jetbrains.kotl" +
"in.metadata.Property\030\257\001 \001(\01321.org.jetbra" +
"ins.kotlin.metadata.konan.InlineIrBody:s" +
"\n\025enum_entry_annotation\022(.org.jetbrains.",
"kotlin.metadata.EnumEntry\030\252\001 \003(\0132).org.j" +
"etbrains.kotlin.metadata.Annotation:E\n\022e" +
"num_entry_ordinal\022(.org.jetbrains.kotlin" +
".metadata.EnumEntry\030\253\001 \001(\005:w\n\024parameter_" +
"annotation\022-.org.jetbrains.kotlin.metada" +
"ta.ValueParameter\030\252\001 \003(\0132).org.jetbrains" +
".kotlin.metadata.Annotation:h\n\017type_anno" +
"tation\022#.org.jetbrains.kotlin.metadata.T" +
"ype\030\252\001 \003(\0132).org.jetbrains.kotlin.metada" +
"ta.Annotation:7\n\ttype_text\022#.org.jetbrai",
"ns.kotlin.metadata.Type\030\254\001 \001(\t:{\n\031type_p" +
"arameter_annotation\022,.org.jetbrains.kotl" +
"in.metadata.TypeParameter\030\252\001 \003(\0132).org.j" +
"etbrains.kotlin.metadata.AnnotationB\024B\022D" +
"ebugKonanProtoBuf"
"ation:w\n\032property_getter_annotation\022\'.or" +
"g.jetbrains.kotlin.metadata.Property\030\260\001 " +
"\003(\0132).org.jetbrains.kotlin.metadata.Anno" +
"tation:w\n\032property_setter_annotation\022\'.o",
"rg.jetbrains.kotlin.metadata.Property\030\261\001" +
" \003(\0132).org.jetbrains.kotlin.metadata.Ann" +
"otation:C\n\021has_backing_field\022\'.org.jetbr" +
"ains.kotlin.metadata.Property\030\253\001 \001(\010:B\n\020" +
"used_as_variable\022\'.org.jetbrains.kotlin." +
"metadata.Property\030\254\001 \001(\010:~\n\022compile_time" +
"_value\022\'.org.jetbrains.kotlin.metadata.P" +
"roperty\030\255\001 \001(\01328.org.jetbrains.kotlin.me" +
"tadata.Annotation.Argument.Value:z\n\025inli" +
"ne_getter_ir_body\022\'.org.jetbrains.kotlin",
".metadata.Property\030\256\001 \001(\01321.org.jetbrain" +
"s.kotlin.metadata.konan.InlineIrBody:z\n\025" +
"inline_setter_ir_body\022\'.org.jetbrains.ko" +
"tlin.metadata.Property\030\257\001 \001(\01321.org.jetb" +
"rains.kotlin.metadata.konan.InlineIrBody" +
":s\n\025enum_entry_annotation\022(.org.jetbrain" +
"s.kotlin.metadata.EnumEntry\030\252\001 \003(\0132).org" +
".jetbrains.kotlin.metadata.Annotation:E\n" +
"\022enum_entry_ordinal\022(.org.jetbrains.kotl" +
"in.metadata.EnumEntry\030\253\001 \001(\005:w\n\024paramete",
"r_annotation\022-.org.jetbrains.kotlin.meta" +
"data.ValueParameter\030\252\001 \003(\0132).org.jetbrai" +
"ns.kotlin.metadata.Annotation:h\n\017type_an" +
"notation\022#.org.jetbrains.kotlin.metadata" +
".Type\030\252\001 \003(\0132).org.jetbrains.kotlin.meta" +
"data.Annotation:7\n\ttype_text\022#.org.jetbr" +
"ains.kotlin.metadata.Type\030\254\001 \001(\t:{\n\031type" +
"_parameter_annotation\022,.org.jetbrains.ko" +
"tlin.metadata.TypeParameter\030\252\001 \003(\0132).org" +
".jetbrains.kotlin.metadata.AnnotationB\024B",
"\022DebugKonanProtoBuf"
};
org.jetbrains.kotlin.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
new org.jetbrains.kotlin.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() {
@@ -4194,17 +4224,19 @@ public final class DebugKonanProtoBuf {
functionAnnotation.internalInit(descriptor.getExtensions().get(4));
inlineIrBody.internalInit(descriptor.getExtensions().get(5));
propertyAnnotation.internalInit(descriptor.getExtensions().get(6));
hasBackingField.internalInit(descriptor.getExtensions().get(7));
usedAsVariable.internalInit(descriptor.getExtensions().get(8));
compileTimeValue.internalInit(descriptor.getExtensions().get(9));
inlineGetterIrBody.internalInit(descriptor.getExtensions().get(10));
inlineSetterIrBody.internalInit(descriptor.getExtensions().get(11));
enumEntryAnnotation.internalInit(descriptor.getExtensions().get(12));
enumEntryOrdinal.internalInit(descriptor.getExtensions().get(13));
parameterAnnotation.internalInit(descriptor.getExtensions().get(14));
typeAnnotation.internalInit(descriptor.getExtensions().get(15));
typeText.internalInit(descriptor.getExtensions().get(16));
typeParameterAnnotation.internalInit(descriptor.getExtensions().get(17));
propertyGetterAnnotation.internalInit(descriptor.getExtensions().get(7));
propertySetterAnnotation.internalInit(descriptor.getExtensions().get(8));
hasBackingField.internalInit(descriptor.getExtensions().get(9));
usedAsVariable.internalInit(descriptor.getExtensions().get(10));
compileTimeValue.internalInit(descriptor.getExtensions().get(11));
inlineGetterIrBody.internalInit(descriptor.getExtensions().get(12));
inlineSetterIrBody.internalInit(descriptor.getExtensions().get(13));
enumEntryAnnotation.internalInit(descriptor.getExtensions().get(14));
enumEntryOrdinal.internalInit(descriptor.getExtensions().get(15));
parameterAnnotation.internalInit(descriptor.getExtensions().get(16));
typeAnnotation.internalInit(descriptor.getExtensions().get(17));
typeText.internalInit(descriptor.getExtensions().get(18));
typeParameterAnnotation.internalInit(descriptor.getExtensions().get(19));
org.jetbrains.kotlin.metadata.DebugProtoBuf.getDescriptor();
}
@@ -36,9 +36,9 @@ object KotlinStubVersions {
// BuiltIn stub version should be increased if changes are made to builtIn stub building subsystem (org.jetbrains.kotlin.idea.decompiler.builtIns)
// Increasing this version will lead to reindexing of all builtIn files (see KotlinBuiltInFileType).
const val BUILTIN_STUB_VERSION = BINARY_STUB_VERSION + 2
const val BUILTIN_STUB_VERSION = BINARY_STUB_VERSION + 3
// JS stub version should be increased if changes are made to js stub building subsystem (org.jetbrains.kotlin.idea.decompiler.js)
// Increasing this version will lead to reindexing of js binary files (see KotlinJavaScriptMetaFileType).
const val JS_STUB_VERSION = BINARY_STUB_VERSION + 2
const val JS_STUB_VERSION = BINARY_STUB_VERSION + 3
}
@@ -61,6 +61,12 @@ abstract class KotlinSerializerExtensionBase(private val protocol: SerializerExt
for (annotation in descriptor.nonSourceAnnotations) {
proto.addExtension(protocol.propertyAnnotation, annotationSerializer.serializeAnnotation(annotation))
}
for (annotation in descriptor.getter?.nonSourceAnnotations.orEmpty()) {
proto.addExtension(protocol.propertyGetterAnnotation, annotationSerializer.serializeAnnotation(annotation))
}
for (annotation in descriptor.setter?.nonSourceAnnotations.orEmpty()) {
proto.addExtension(protocol.propertySetterAnnotation, annotationSerializer.serializeAnnotation(annotation))
}
val constantInitializer = descriptor.compileTimeInitializer ?: return
if (constantInitializer !is NullValue) {
proto.setExtension(protocol.compileTimeValue, annotationSerializer.valueProto(constantInitializer).build())
@@ -0,0 +1,10 @@
package test
annotation class Anno(val value: String)
@Anno("property") val v1 = ""
var v2: String
@Anno("getter") get() = ""
@Anno("setter") set(@Anno("setparam") value) {
}
@@ -0,0 +1,9 @@
package test
@test.Anno(value = "property") public val v1: kotlin.String = ""
@get:test.Anno(value = "getter") @set:test.Anno(value = "setter") @setparam:test.Anno(value = "setparam") public var v2: kotlin.String
public final annotation class Anno : kotlin.Annotation {
public constructor Anno(/*0*/ value: kotlin.String)
public final val value: kotlin.String
}
@@ -112,4 +112,8 @@ class BuiltInsSerializerTest : TestCaseWithTmpdir() {
fun testBinaryRetainedAnnotation() {
doTest("binaryRetainedAnnotation.kt")
}
fun testPropertyAccessorAnnotations() {
doTest("propertyAccessorAnnotations.kt")
}
}
@@ -152,4 +152,8 @@ class KotlinJavascriptSerializerTest : TestCaseWithTmpdir() {
fun testEnum() {
doTest("builtinsSerializer/annotationArguments/enum.kt")
}
fun testPropertyAccessorAnnotations() {
doTest("builtinsSerializer/propertyAccessorAnnotations.kt")
}
}
@@ -33,7 +33,7 @@ class JsMetadataVersion(vararg numbers: Int) : BinaryVersion(*numbers) {
companion object {
@JvmField
val INSTANCE = JsMetadataVersion(1, 2, 5)
val INSTANCE = JsMetadataVersion(1, 2, 6)
@JvmField
val INVALID_VERSION = JsMetadataVersion()
@@ -27,6 +27,8 @@ open class SerializerExtensionProtocol(
val classAnnotation: GeneratedExtension<ProtoBuf.Class, List<ProtoBuf.Annotation>>,
val functionAnnotation: GeneratedExtension<ProtoBuf.Function, List<ProtoBuf.Annotation>>,
val propertyAnnotation: GeneratedExtension<ProtoBuf.Property, List<ProtoBuf.Annotation>>,
val propertyGetterAnnotation: GeneratedExtension<ProtoBuf.Property, List<ProtoBuf.Annotation>>,
val propertySetterAnnotation: GeneratedExtension<ProtoBuf.Property, List<ProtoBuf.Annotation>>,
val enumEntryAnnotation: GeneratedExtension<ProtoBuf.EnumEntry, List<ProtoBuf.Annotation>>,
val compileTimeValue: GeneratedExtension<ProtoBuf.Property, ProtoBuf.Annotation.Argument.Value>,
val parameterAnnotation: GeneratedExtension<ProtoBuf.ValueParameter, List<ProtoBuf.Annotation>>,
@@ -47,7 +47,12 @@ class AnnotationAndConstantLoaderImpl(
val annotations = when (proto) {
is ProtoBuf.Constructor -> proto.getExtension(protocol.constructorAnnotation)
is ProtoBuf.Function -> proto.getExtension(protocol.functionAnnotation)
is ProtoBuf.Property -> proto.getExtension(protocol.propertyAnnotation)
is ProtoBuf.Property -> when (kind) {
AnnotatedCallableKind.PROPERTY -> proto.getExtension(protocol.propertyAnnotation)
AnnotatedCallableKind.PROPERTY_GETTER -> proto.getExtension(protocol.propertyGetterAnnotation)
AnnotatedCallableKind.PROPERTY_SETTER -> proto.getExtension(protocol.propertySetterAnnotation)
else -> error("Unsupported callable kind with property proto")
}
else -> error("Unknown message: $proto")
}.orEmpty()
return annotations.map { annotationProto ->
@@ -11,11 +11,19 @@ import org.jetbrains.kotlin.protobuf.ExtensionRegistryLite
import org.jetbrains.kotlin.serialization.SerializerExtensionProtocol
object BuiltInSerializerProtocol : SerializerExtensionProtocol(
ExtensionRegistryLite.newInstance().apply { BuiltInsProtoBuf.registerAllExtensions(this) },
ExtensionRegistryLite.newInstance().apply(BuiltInsProtoBuf::registerAllExtensions),
BuiltInsProtoBuf.packageFqName,
BuiltInsProtoBuf.constructorAnnotation, BuiltInsProtoBuf.classAnnotation, BuiltInsProtoBuf.functionAnnotation,
BuiltInsProtoBuf.propertyAnnotation, BuiltInsProtoBuf.enumEntryAnnotation, BuiltInsProtoBuf.compileTimeValue,
BuiltInsProtoBuf.parameterAnnotation, BuiltInsProtoBuf.typeAnnotation, BuiltInsProtoBuf.typeParameterAnnotation
BuiltInsProtoBuf.constructorAnnotation,
BuiltInsProtoBuf.classAnnotation,
BuiltInsProtoBuf.functionAnnotation,
BuiltInsProtoBuf.propertyAnnotation,
BuiltInsProtoBuf.propertyGetterAnnotation,
BuiltInsProtoBuf.propertySetterAnnotation,
BuiltInsProtoBuf.enumEntryAnnotation,
BuiltInsProtoBuf.compileTimeValue,
BuiltInsProtoBuf.parameterAnnotation,
BuiltInsProtoBuf.typeAnnotation,
BuiltInsProtoBuf.typeParameterAnnotation
) {
const val BUILTINS_FILE_EXTENSION = "kotlin_builtins"
+2
View File
@@ -39,6 +39,8 @@ extend Function {
extend Property {
repeated Annotation property_annotation = 150;
repeated Annotation property_getter_annotation = 152;
repeated Annotation property_setter_annotation = 153;
optional Annotation.Argument.Value compile_time_value = 151;
}
@@ -19,7 +19,7 @@ class BuiltInsBinaryVersion(vararg numbers: Int) : BinaryVersion(*numbers) {
companion object {
@JvmField
val INSTANCE = BuiltInsBinaryVersion(1, 0, 6)
val INSTANCE = BuiltInsBinaryVersion(1, 0, 7)
@JvmField
val INVALID_VERSION = BuiltInsBinaryVersion()
@@ -12,6 +12,8 @@ public final class BuiltInsProtoBuf {
registry.add(org.jetbrains.kotlin.metadata.builtins.BuiltInsProtoBuf.constructorAnnotation);
registry.add(org.jetbrains.kotlin.metadata.builtins.BuiltInsProtoBuf.functionAnnotation);
registry.add(org.jetbrains.kotlin.metadata.builtins.BuiltInsProtoBuf.propertyAnnotation);
registry.add(org.jetbrains.kotlin.metadata.builtins.BuiltInsProtoBuf.propertyGetterAnnotation);
registry.add(org.jetbrains.kotlin.metadata.builtins.BuiltInsProtoBuf.propertySetterAnnotation);
registry.add(org.jetbrains.kotlin.metadata.builtins.BuiltInsProtoBuf.compileTimeValue);
registry.add(org.jetbrains.kotlin.metadata.builtins.BuiltInsProtoBuf.enumEntryAnnotation);
registry.add(org.jetbrains.kotlin.metadata.builtins.BuiltInsProtoBuf.parameterAnnotation);
@@ -98,6 +100,38 @@ public final class BuiltInsProtoBuf {
org.jetbrains.kotlin.protobuf.WireFormat.FieldType.MESSAGE,
false,
org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.class);
public static final int PROPERTY_GETTER_ANNOTATION_FIELD_NUMBER = 152;
/**
* <code>extend .org.jetbrains.kotlin.metadata.Property { ... }</code>
*/
public static final
org.jetbrains.kotlin.protobuf.GeneratedMessageLite.GeneratedExtension<
org.jetbrains.kotlin.metadata.ProtoBuf.Property,
java.util.List<org.jetbrains.kotlin.metadata.ProtoBuf.Annotation>> propertyGetterAnnotation = org.jetbrains.kotlin.protobuf.GeneratedMessageLite
.newRepeatedGeneratedExtension(
org.jetbrains.kotlin.metadata.ProtoBuf.Property.getDefaultInstance(),
org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.getDefaultInstance(),
null,
152,
org.jetbrains.kotlin.protobuf.WireFormat.FieldType.MESSAGE,
false,
org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.class);
public static final int PROPERTY_SETTER_ANNOTATION_FIELD_NUMBER = 153;
/**
* <code>extend .org.jetbrains.kotlin.metadata.Property { ... }</code>
*/
public static final
org.jetbrains.kotlin.protobuf.GeneratedMessageLite.GeneratedExtension<
org.jetbrains.kotlin.metadata.ProtoBuf.Property,
java.util.List<org.jetbrains.kotlin.metadata.ProtoBuf.Annotation>> propertySetterAnnotation = org.jetbrains.kotlin.protobuf.GeneratedMessageLite
.newRepeatedGeneratedExtension(
org.jetbrains.kotlin.metadata.ProtoBuf.Property.getDefaultInstance(),
org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.getDefaultInstance(),
null,
153,
org.jetbrains.kotlin.protobuf.WireFormat.FieldType.MESSAGE,
false,
org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.class);
public static final int COMPILE_TIME_VALUE_FIELD_NUMBER = 151;
/**
* <code>extend .org.jetbrains.kotlin.metadata.Property { ... }</code>
@@ -42,7 +42,12 @@ class AnnotationLoaderForStubBuilderImpl(
val annotations = when (proto) {
is ProtoBuf.Constructor -> proto.getExtension(protocol.constructorAnnotation)
is ProtoBuf.Function -> proto.getExtension(protocol.functionAnnotation)
is ProtoBuf.Property -> proto.getExtension(protocol.propertyAnnotation)
is ProtoBuf.Property -> when (kind) {
AnnotatedCallableKind.PROPERTY -> proto.getExtension(protocol.propertyAnnotation)
AnnotatedCallableKind.PROPERTY_GETTER -> proto.getExtension(protocol.propertyGetterAnnotation)
AnnotatedCallableKind.PROPERTY_SETTER -> proto.getExtension(protocol.propertySetterAnnotation)
else -> error("Unsupported callable kind with property proto")
}
else -> error("Unknown message: $proto")
}.orEmpty()
return annotations.map { container.nameResolver.getClassId(it.id) }
+2
View File
@@ -71,6 +71,8 @@ extend Function {
extend Property {
repeated Annotation property_annotation = 130;
repeated Annotation property_getter_annotation = 132;
repeated Annotation property_setter_annotation = 133;
optional Annotation.Argument.Value compile_time_value = 131;
optional int32 property_containing_file_id = 135;
}
@@ -14,6 +14,8 @@ public final class JsProtoBuf {
registry.add(org.jetbrains.kotlin.metadata.js.JsProtoBuf.functionAnnotation);
registry.add(org.jetbrains.kotlin.metadata.js.JsProtoBuf.functionContainingFileId);
registry.add(org.jetbrains.kotlin.metadata.js.JsProtoBuf.propertyAnnotation);
registry.add(org.jetbrains.kotlin.metadata.js.JsProtoBuf.propertyGetterAnnotation);
registry.add(org.jetbrains.kotlin.metadata.js.JsProtoBuf.propertySetterAnnotation);
registry.add(org.jetbrains.kotlin.metadata.js.JsProtoBuf.compileTimeValue);
registry.add(org.jetbrains.kotlin.metadata.js.JsProtoBuf.propertyContainingFileId);
registry.add(org.jetbrains.kotlin.metadata.js.JsProtoBuf.enumEntryAnnotation);
@@ -3755,6 +3757,38 @@ public final class JsProtoBuf {
org.jetbrains.kotlin.protobuf.WireFormat.FieldType.MESSAGE,
false,
org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.class);
public static final int PROPERTY_GETTER_ANNOTATION_FIELD_NUMBER = 132;
/**
* <code>extend .org.jetbrains.kotlin.metadata.Property { ... }</code>
*/
public static final
org.jetbrains.kotlin.protobuf.GeneratedMessageLite.GeneratedExtension<
org.jetbrains.kotlin.metadata.ProtoBuf.Property,
java.util.List<org.jetbrains.kotlin.metadata.ProtoBuf.Annotation>> propertyGetterAnnotation = org.jetbrains.kotlin.protobuf.GeneratedMessageLite
.newRepeatedGeneratedExtension(
org.jetbrains.kotlin.metadata.ProtoBuf.Property.getDefaultInstance(),
org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.getDefaultInstance(),
null,
132,
org.jetbrains.kotlin.protobuf.WireFormat.FieldType.MESSAGE,
false,
org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.class);
public static final int PROPERTY_SETTER_ANNOTATION_FIELD_NUMBER = 133;
/**
* <code>extend .org.jetbrains.kotlin.metadata.Property { ... }</code>
*/
public static final
org.jetbrains.kotlin.protobuf.GeneratedMessageLite.GeneratedExtension<
org.jetbrains.kotlin.metadata.ProtoBuf.Property,
java.util.List<org.jetbrains.kotlin.metadata.ProtoBuf.Annotation>> propertySetterAnnotation = org.jetbrains.kotlin.protobuf.GeneratedMessageLite
.newRepeatedGeneratedExtension(
org.jetbrains.kotlin.metadata.ProtoBuf.Property.getDefaultInstance(),
org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.getDefaultInstance(),
null,
133,
org.jetbrains.kotlin.protobuf.WireFormat.FieldType.MESSAGE,
false,
org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.class);
public static final int COMPILE_TIME_VALUE_FIELD_NUMBER = 131;
/**
* <code>extend .org.jetbrains.kotlin.metadata.Property { ... }</code>
@@ -12,16 +12,14 @@ import org.jetbrains.kotlin.protobuf.ExtensionRegistryLite
import org.jetbrains.kotlin.serialization.SerializerExtensionProtocol
object JsSerializerProtocol : SerializerExtensionProtocol(
ExtensionRegistryLite.newInstance().apply {
JsProtoBuf.registerAllExtensions(
this
)
},
ExtensionRegistryLite.newInstance().apply(JsProtoBuf::registerAllExtensions),
JsProtoBuf.packageFqName,
JsProtoBuf.constructorAnnotation,
JsProtoBuf.classAnnotation,
JsProtoBuf.functionAnnotation,
JsProtoBuf.propertyAnnotation,
JsProtoBuf.propertyGetterAnnotation,
JsProtoBuf.propertySetterAnnotation,
JsProtoBuf.enumEntryAnnotation,
JsProtoBuf.compileTimeValue,
JsProtoBuf.parameterAnnotation,
@@ -35,4 +33,4 @@ object JsSerializerProtocol : SerializerExtensionProtocol(
"." +
KotlinJavascriptSerializationUtil.CLASS_METADATA_FILE_EXTENSION
}
}
}
@@ -5348,6 +5348,11 @@ public class BoxJsTestGenerated extends AbstractBoxJsTest {
runTest("js/js.translator/testData/box/jsName/privateMethod.kt");
}
@TestMetadata("propertyAccessorFromOtherModule.kt")
public void testPropertyAccessorFromOtherModule() throws Exception {
runTest("js/js.translator/testData/box/jsName/propertyAccessorFromOtherModule.kt");
}
@TestMetadata("secondaryConstructor.kt")
public void testSecondaryConstructor() throws Exception {
runTest("js/js.translator/testData/box/jsName/secondaryConstructor.kt");
@@ -5348,6 +5348,11 @@ public class IrBoxJsTestGenerated extends AbstractIrBoxJsTest {
runTest("js/js.translator/testData/box/jsName/privateMethod.kt");
}
@TestMetadata("propertyAccessorFromOtherModule.kt")
public void testPropertyAccessorFromOtherModule() throws Exception {
runTest("js/js.translator/testData/box/jsName/propertyAccessorFromOtherModule.kt");
}
@TestMetadata("secondaryConstructor.kt")
public void testSecondaryConstructor() throws Exception {
runTest("js/js.translator/testData/box/jsName/secondaryConstructor.kt");
@@ -0,0 +1,18 @@
// EXPECTED_REACHABLE_NODES: 1281
// MODULE: lib
// FILE: lib.kt
package lib
val foo: Int
@JsName("getBar") get() = 23
// MODULE: main(lib)
// FILE: main.kt
package main
import lib.*
fun box(): String {
if (foo != 23) return "fail: $foo"
return "OK"
}
+2
View File
@@ -34,6 +34,8 @@ extend Function {
extend Property {
repeated Annotation property_annotation = 170;
repeated Annotation property_getter_annotation = 176;
repeated Annotation property_setter_annotation = 177;
optional bool has_backing_field = 171;
optional bool used_as_variable = 172;
optional Annotation.Argument.Value compile_time_value = 173;
@@ -14,6 +14,8 @@ public final class KonanProtoBuf {
registry.add(org.jetbrains.kotlin.metadata.konan.KonanProtoBuf.functionAnnotation);
registry.add(org.jetbrains.kotlin.metadata.konan.KonanProtoBuf.inlineIrBody);
registry.add(org.jetbrains.kotlin.metadata.konan.KonanProtoBuf.propertyAnnotation);
registry.add(org.jetbrains.kotlin.metadata.konan.KonanProtoBuf.propertyGetterAnnotation);
registry.add(org.jetbrains.kotlin.metadata.konan.KonanProtoBuf.propertySetterAnnotation);
registry.add(org.jetbrains.kotlin.metadata.konan.KonanProtoBuf.hasBackingField);
registry.add(org.jetbrains.kotlin.metadata.konan.KonanProtoBuf.usedAsVariable);
registry.add(org.jetbrains.kotlin.metadata.konan.KonanProtoBuf.compileTimeValue);
@@ -3315,6 +3317,38 @@ public final class KonanProtoBuf {
org.jetbrains.kotlin.protobuf.WireFormat.FieldType.MESSAGE,
false,
org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.class);
public static final int PROPERTY_GETTER_ANNOTATION_FIELD_NUMBER = 176;
/**
* <code>extend .org.jetbrains.kotlin.metadata.Property { ... }</code>
*/
public static final
org.jetbrains.kotlin.protobuf.GeneratedMessageLite.GeneratedExtension<
org.jetbrains.kotlin.metadata.ProtoBuf.Property,
java.util.List<org.jetbrains.kotlin.metadata.ProtoBuf.Annotation>> propertyGetterAnnotation = org.jetbrains.kotlin.protobuf.GeneratedMessageLite
.newRepeatedGeneratedExtension(
org.jetbrains.kotlin.metadata.ProtoBuf.Property.getDefaultInstance(),
org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.getDefaultInstance(),
null,
176,
org.jetbrains.kotlin.protobuf.WireFormat.FieldType.MESSAGE,
false,
org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.class);
public static final int PROPERTY_SETTER_ANNOTATION_FIELD_NUMBER = 177;
/**
* <code>extend .org.jetbrains.kotlin.metadata.Property { ... }</code>
*/
public static final
org.jetbrains.kotlin.protobuf.GeneratedMessageLite.GeneratedExtension<
org.jetbrains.kotlin.metadata.ProtoBuf.Property,
java.util.List<org.jetbrains.kotlin.metadata.ProtoBuf.Annotation>> propertySetterAnnotation = org.jetbrains.kotlin.protobuf.GeneratedMessageLite
.newRepeatedGeneratedExtension(
org.jetbrains.kotlin.metadata.ProtoBuf.Property.getDefaultInstance(),
org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.getDefaultInstance(),
null,
177,
org.jetbrains.kotlin.protobuf.WireFormat.FieldType.MESSAGE,
false,
org.jetbrains.kotlin.metadata.ProtoBuf.Annotation.class);
public static final int HAS_BACKING_FIELD_FIELD_NUMBER = 171;
/**
* <code>extend .org.jetbrains.kotlin.metadata.Property { ... }</code>
@@ -10,12 +10,14 @@ import org.jetbrains.kotlin.protobuf.ExtensionRegistryLite
import org.jetbrains.kotlin.serialization.SerializerExtensionProtocol
object KonanSerializerProtocol : SerializerExtensionProtocol(
ExtensionRegistryLite.newInstance().apply { KonanProtoBuf.registerAllExtensions(this) },
ExtensionRegistryLite.newInstance().apply(KonanProtoBuf::registerAllExtensions),
KonanProtoBuf.packageFqName,
KonanProtoBuf.constructorAnnotation,
KonanProtoBuf.classAnnotation,
KonanProtoBuf.functionAnnotation,
KonanProtoBuf.propertyAnnotation,
KonanProtoBuf.propertyGetterAnnotation,
KonanProtoBuf.propertySetterAnnotation,
KonanProtoBuf.enumEntryAnnotation,
KonanProtoBuf.compileTimeValue,
KonanProtoBuf.parameterAnnotation,