diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrAnnotationsFromPluginRegistrar.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrAnnotationsFromPluginRegistrar.kt index e2e699ecfcd..186d8665ef0 100644 --- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrAnnotationsFromPluginRegistrar.kt +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrAnnotationsFromPluginRegistrar.kt @@ -80,7 +80,7 @@ class Fir2IrAnnotationsFromPluginRegistrar(private val components: Fir2IrCompone val fileFqName = firFile.packageFqName.child(Name.identifier(firFile.name)).asString() val source = declaration.source ?: return emptyList() val fileStorage = generatedIrDeclarationsByFileByOffset[fileFqName] ?: return emptyList() - return fileStorage[source.startOffset to source.endOffset] ?: emptyList() + return fileStorage[(source.startOffsetSkippingComments() ?: source.startOffset) to source.endOffset] ?: emptyList() } private fun FirDeclaration.containingFile(): FirFile? { diff --git a/plugins/fir-plugin-prototype/testData/firLoadK2Compiled/annotationsGeneratedInBackend.fir.k2.klib.txt b/plugins/fir-plugin-prototype/testData/firLoadK2Compiled/annotationsGeneratedInBackend.fir.k2.klib.txt index 1fe5b9ad434..8b998bb9d20 100644 --- a/plugins/fir-plugin-prototype/testData/firLoadK2Compiled/annotationsGeneratedInBackend.fir.k2.klib.txt +++ b/plugins/fir-plugin-prototype/testData/firLoadK2Compiled/annotationsGeneratedInBackend.fir.k2.klib.txt @@ -6,8 +6,8 @@ @R|org/jetbrains/kotlin/fir/plugin/AnnotationToAdd|(booleanValue = Boolean(true), byteValue = Byte(1), charValue = Char(c), doubleValue = Double(4.2), floatValue = Float(2.4), intValue = Int(42), longValue = Long(24), shortValue = Short(7), stringValue = String(OK)) public constructor(@R|org/jetbrains/kotlin/fir/plugin/AnnotationToAdd|(booleanValue = Boolean(true), byteValue = Byte(1), charValue = Char(c), doubleValue = Double(4.2), floatValue = Float(2.4), intValue = Int(42), longValue = Long(24), shortValue = Short(7), stringValue = String(OK)) @R|org/jetbrains/kotlin/fir/plugin/AnnotationToAdd|(booleanValue = Boolean(true), byteValue = Byte(1), charValue = Char(c), doubleValue = Double(4.2), floatValue = Float(2.4), intValue = Int(42), longValue = Long(24), shortValue = Short(7), stringValue = String(OK)) @R|org/jetbrains/kotlin/fir/plugin/AnnotationToAdd|(booleanValue = Boolean(true), byteValue = Byte(1), charValue = Char(c), doubleValue = Double(4.2), floatValue = Float(2.4), intValue = Int(42), longValue = Long(24), shortValue = Short(7), stringValue = String(OK)) @R|org/jetbrains/kotlin/fir/plugin/AnnotationToAdd|(booleanValue = Boolean(true), byteValue = Byte(1), charValue = Char(c), doubleValue = Double(4.2), floatValue = Float(2.4), intValue = Int(42), longValue = Long(24), shortValue = Short(7), stringValue = String(OK)) @R|org/jetbrains/kotlin/fir/plugin/AnnotationToAdd|(booleanValue = Boolean(true), byteValue = Byte(1), charValue = Char(c), doubleValue = Double(4.2), floatValue = Float(2.4), intValue = Int(42), longValue = Long(24), shortValue = Short(7), stringValue = String(OK)) x: R|kotlin/Int|): R|test/Some| - public final class Derived : R|kotlin/Any| { - public constructor(): R|test/Some.Derived| + @R|org/jetbrains/kotlin/fir/plugin/AnnotationToAdd|(booleanValue = Boolean(true), byteValue = Byte(1), charValue = Char(c), doubleValue = Double(4.2), floatValue = Float(2.4), intValue = Int(42), longValue = Long(24), shortValue = Short(7), stringValue = String(OK)) @R|org/jetbrains/kotlin/fir/plugin/AnnotationToAdd|(booleanValue = Boolean(true), byteValue = Byte(1), charValue = Char(c), doubleValue = Double(4.2), floatValue = Float(2.4), intValue = Int(42), longValue = Long(24), shortValue = Short(7), stringValue = String(OK)) @R|org/jetbrains/kotlin/fir/plugin/AnnotationToAdd|(booleanValue = Boolean(true), byteValue = Byte(1), charValue = Char(c), doubleValue = Double(4.2), floatValue = Float(2.4), intValue = Int(42), longValue = Long(24), shortValue = Short(7), stringValue = String(OK)) public final class Derived : R|kotlin/Any| { + @R|org/jetbrains/kotlin/fir/plugin/AnnotationToAdd|(booleanValue = Boolean(true), byteValue = Byte(1), charValue = Char(c), doubleValue = Double(4.2), floatValue = Float(2.4), intValue = Int(42), longValue = Long(24), shortValue = Short(7), stringValue = String(OK)) @R|org/jetbrains/kotlin/fir/plugin/AnnotationToAdd|(booleanValue = Boolean(true), byteValue = Byte(1), charValue = Char(c), doubleValue = Double(4.2), floatValue = Float(2.4), intValue = Int(42), longValue = Long(24), shortValue = Short(7), stringValue = String(OK)) @R|org/jetbrains/kotlin/fir/plugin/AnnotationToAdd|(booleanValue = Boolean(true), byteValue = Byte(1), charValue = Char(c), doubleValue = Double(4.2), floatValue = Float(2.4), intValue = Int(42), longValue = Long(24), shortValue = Short(7), stringValue = String(OK)) public constructor(): R|test/Some.Derived| }