diff --git a/analysis/decompiled/decompiler-to-file-stubs/src/org/jetbrains/kotlin/analysis/decompiler/stub/file/AnnotationLoaderForStubBuilderImpl.kt b/analysis/decompiled/decompiler-to-file-stubs/src/org/jetbrains/kotlin/analysis/decompiler/stub/file/AnnotationLoaderForStubBuilderImpl.kt index 76975d8d7ba..afada744ec0 100644 --- a/analysis/decompiled/decompiler-to-file-stubs/src/org/jetbrains/kotlin/analysis/decompiler/stub/file/AnnotationLoaderForStubBuilderImpl.kt +++ b/analysis/decompiled/decompiler-to-file-stubs/src/org/jetbrains/kotlin/analysis/decompiler/stub/file/AnnotationLoaderForStubBuilderImpl.kt @@ -40,11 +40,19 @@ class AnnotationLoaderForStubBuilderImpl( return annotations.map { loadAnnotation(it, container.nameResolver) } } - override fun loadPropertyBackingFieldAnnotations(container: ProtoContainer, proto: ProtoBuf.Property): List = - emptyList() + override fun loadPropertyBackingFieldAnnotations(container: ProtoContainer, proto: ProtoBuf.Property): List { + val annotations = protocol.propertyBackingFieldAnnotation?.let { proto.getExtension(it) }.orEmpty() + return annotations.map { annotationProto -> + loadAnnotation(annotationProto, container.nameResolver) + } + } - override fun loadPropertyDelegateFieldAnnotations(container: ProtoContainer, proto: ProtoBuf.Property): List = - emptyList() + override fun loadPropertyDelegateFieldAnnotations(container: ProtoContainer, proto: ProtoBuf.Property): List { + val annotations = protocol.propertyDelegatedFieldAnnotation?.let {proto.getExtension(it) }.orEmpty() + return annotations.map { annotationProto -> + loadAnnotation(annotationProto, container.nameResolver) + } + } override fun loadEnumEntryAnnotations(container: ProtoContainer, proto: ProtoBuf.EnumEntry): List = proto.getExtension(protocol.enumEntryAnnotation).orEmpty().map { loadAnnotation(it, container.nameResolver) } @@ -62,7 +70,21 @@ class AnnotationLoaderForStubBuilderImpl( container: ProtoContainer, proto: MessageLite, kind: AnnotatedCallableKind - ): List = emptyList() + ): List { + val annotations = when (proto) { + is ProtoBuf.Function -> protocol.functionExtensionReceiverAnnotation?.let { proto.getExtension(it) } + is ProtoBuf.Property -> when (kind) { + AnnotatedCallableKind.PROPERTY, AnnotatedCallableKind.PROPERTY_GETTER, AnnotatedCallableKind.PROPERTY_SETTER -> { + protocol.propertyExtensionReceiverAnnotation?.let { proto.getExtension(it) } + } + else -> error("Unsupported callable kind with property proto for receiver annotations: $kind") + } + else -> error("Unknown message: $proto") + }.orEmpty() + return annotations.map { annotationProto -> + loadAnnotation(annotationProto, container.nameResolver) + } + } override fun loadTypeAnnotations( proto: ProtoBuf.Type, diff --git a/analysis/decompiled/decompiler-to-file-stubs/testData/clsFileStubBuilder/AnnotationsOnNullableTypes/AnnotationsOnNullableTypes.kt b/analysis/decompiled/decompiler-to-file-stubs/testData/clsFileStubBuilder/AnnotationsOnNullableTypes/AnnotationsOnNullableTypes.kt index b06464e320f..311a08b5390 100644 --- a/analysis/decompiled/decompiler-to-file-stubs/testData/clsFileStubBuilder/AnnotationsOnNullableTypes/AnnotationsOnNullableTypes.kt +++ b/analysis/decompiled/decompiler-to-file-stubs/testData/clsFileStubBuilder/AnnotationsOnNullableTypes/AnnotationsOnNullableTypes.kt @@ -1,5 +1,3 @@ -// Issue: KTIJ-26761 -// KNM_K2_IGNORE public class AnnotationsOnNullableTypes { fun B<@A C?>.receiverArgument() {} diff --git a/analysis/decompiled/decompiler-to-file-stubs/testData/clsFileStubBuilder/TopLevelMembersKt/TopLevelMembers.kt b/analysis/decompiled/decompiler-to-file-stubs/testData/clsFileStubBuilder/TopLevelMembersKt/TopLevelMembers.kt index 557b9a913ba..3b9ae59b162 100644 --- a/analysis/decompiled/decompiler-to-file-stubs/testData/clsFileStubBuilder/TopLevelMembersKt/TopLevelMembers.kt +++ b/analysis/decompiled/decompiler-to-file-stubs/testData/clsFileStubBuilder/TopLevelMembersKt/TopLevelMembers.kt @@ -1,6 +1,3 @@ -// Issue: KTIJ-26761 -// KNM_K2_IGNORE - package foo.TopLevelMembers fun funWithBlockBody() { diff --git a/compiler/psi/src/org/jetbrains/kotlin/psi/stubs/KotlinStubVersions.kt b/compiler/psi/src/org/jetbrains/kotlin/psi/stubs/KotlinStubVersions.kt index 0f820b865ae..a4013d17ce6 100644 --- a/compiler/psi/src/org/jetbrains/kotlin/psi/stubs/KotlinStubVersions.kt +++ b/compiler/psi/src/org/jetbrains/kotlin/psi/stubs/KotlinStubVersions.kt @@ -25,9 +25,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 + 4 + const val BUILTIN_STUB_VERSION = BINARY_STUB_VERSION + 5 // 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 + 3 + const val JS_STUB_VERSION = BINARY_STUB_VERSION + 4 }