Load annotations for default getter and setter
#KT-14697 Fixed
This commit is contained in:
@@ -0,0 +1,15 @@
|
|||||||
|
// IGNORE_BACKEND: NATIVE
|
||||||
|
// FILE: A.kt
|
||||||
|
package lib
|
||||||
|
|
||||||
|
@set:JvmName("renamedSetFoo")
|
||||||
|
@get:JvmName("renamedGetFoo")
|
||||||
|
var foo = "not set"
|
||||||
|
|
||||||
|
// FILE: B.kt
|
||||||
|
import lib.*
|
||||||
|
|
||||||
|
fun box(): String {
|
||||||
|
foo = "OK"
|
||||||
|
return foo
|
||||||
|
}
|
||||||
+6
@@ -240,6 +240,12 @@ public class CompileKotlinAgainstKotlinTestGenerated extends AbstractCompileKotl
|
|||||||
doTest(fileName);
|
doTest(fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("targetedJvmName.kt")
|
||||||
|
public void testTargetedJvmName() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/compileKotlinAgainstKotlin/targetedJvmName.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("typeAliasesKt13181.kt")
|
@TestMetadata("typeAliasesKt13181.kt")
|
||||||
public void testTypeAliasesKt13181() throws Exception {
|
public void testTypeAliasesKt13181() throws Exception {
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/compileKotlinAgainstKotlin/typeAliasesKt13181.kt");
|
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/compileKotlinAgainstKotlin/typeAliasesKt13181.kt");
|
||||||
|
|||||||
+6
-4
@@ -75,10 +75,11 @@ class MemberDeserializer(private val c: DeserializationContext) {
|
|||||||
val isNotDefault = proto.hasGetterFlags() && Flags.IS_NOT_DEFAULT.get(getterFlags)
|
val isNotDefault = proto.hasGetterFlags() && Flags.IS_NOT_DEFAULT.get(getterFlags)
|
||||||
val isExternal = proto.hasGetterFlags() && Flags.IS_EXTERNAL_ACCESSOR.get(getterFlags)
|
val isExternal = proto.hasGetterFlags() && Flags.IS_EXTERNAL_ACCESSOR.get(getterFlags)
|
||||||
val isInline = proto.hasGetterFlags() && Flags.IS_INLINE_ACCESSOR.get(getterFlags)
|
val isInline = proto.hasGetterFlags() && Flags.IS_INLINE_ACCESSOR.get(getterFlags)
|
||||||
|
val annotations = getAnnotations(proto, getterFlags, AnnotatedCallableKind.PROPERTY_GETTER)
|
||||||
val getter = if (isNotDefault) {
|
val getter = if (isNotDefault) {
|
||||||
PropertyGetterDescriptorImpl(
|
PropertyGetterDescriptorImpl(
|
||||||
property,
|
property,
|
||||||
getAnnotations(proto, getterFlags, AnnotatedCallableKind.PROPERTY_GETTER),
|
annotations,
|
||||||
Deserialization.modality(Flags.MODALITY.get(getterFlags)),
|
Deserialization.modality(Flags.MODALITY.get(getterFlags)),
|
||||||
Deserialization.visibility(Flags.VISIBILITY.get(getterFlags)),
|
Deserialization.visibility(Flags.VISIBILITY.get(getterFlags)),
|
||||||
/* isDefault = */ !isNotDefault,
|
/* isDefault = */ !isNotDefault,
|
||||||
@@ -88,7 +89,7 @@ class MemberDeserializer(private val c: DeserializationContext) {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
DescriptorFactory.createDefaultGetter(property, Annotations.EMPTY)
|
DescriptorFactory.createDefaultGetter(property, annotations)
|
||||||
}
|
}
|
||||||
getter.initialize(property.returnType)
|
getter.initialize(property.returnType)
|
||||||
getter
|
getter
|
||||||
@@ -102,10 +103,11 @@ class MemberDeserializer(private val c: DeserializationContext) {
|
|||||||
val isNotDefault = proto.hasSetterFlags() && Flags.IS_NOT_DEFAULT.get(setterFlags)
|
val isNotDefault = proto.hasSetterFlags() && Flags.IS_NOT_DEFAULT.get(setterFlags)
|
||||||
val isExternal = proto.hasSetterFlags() && Flags.IS_EXTERNAL_ACCESSOR.get(setterFlags)
|
val isExternal = proto.hasSetterFlags() && Flags.IS_EXTERNAL_ACCESSOR.get(setterFlags)
|
||||||
val isInline = proto.hasGetterFlags() && Flags.IS_INLINE_ACCESSOR.get(setterFlags)
|
val isInline = proto.hasGetterFlags() && Flags.IS_INLINE_ACCESSOR.get(setterFlags)
|
||||||
|
val annotations = getAnnotations(proto, setterFlags, AnnotatedCallableKind.PROPERTY_SETTER)
|
||||||
if (isNotDefault) {
|
if (isNotDefault) {
|
||||||
val setter = PropertySetterDescriptorImpl(
|
val setter = PropertySetterDescriptorImpl(
|
||||||
property,
|
property,
|
||||||
getAnnotations(proto, setterFlags, AnnotatedCallableKind.PROPERTY_SETTER),
|
annotations,
|
||||||
Deserialization.modality(Flags.MODALITY.get(setterFlags)),
|
Deserialization.modality(Flags.MODALITY.get(setterFlags)),
|
||||||
Deserialization.visibility(Flags.VISIBILITY.get(setterFlags)),
|
Deserialization.visibility(Flags.VISIBILITY.get(setterFlags)),
|
||||||
/* isDefault = */ !isNotDefault,
|
/* isDefault = */ !isNotDefault,
|
||||||
@@ -121,7 +123,7 @@ class MemberDeserializer(private val c: DeserializationContext) {
|
|||||||
setter
|
setter
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
DescriptorFactory.createDefaultSetter(property, Annotations.EMPTY)
|
DescriptorFactory.createDefaultSetter(property, annotations)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
Reference in New Issue
Block a user