diff --git a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBlackBoxCodegenTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBlackBoxCodegenTestGenerated.java index 3f539bc455a..28d5d97a02b 100644 --- a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBlackBoxCodegenTestGenerated.java +++ b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBlackBoxCodegenTestGenerated.java @@ -33727,6 +33727,12 @@ public class FirLightTreeBlackBoxCodegenTestGenerated extends AbstractFirLightTr runTest("compiler/testData/codegen/box/multiplatform/k2/annotations/annotationsViaActualTypeAliasFromBinary.kt"); } + @Test + @TestMetadata("expectAnnotationCallInLibrary.kt") + public void testExpectAnnotationCallInLibrary() throws Exception { + runTest("compiler/testData/codegen/box/multiplatform/k2/annotations/expectAnnotationCallInLibrary.kt"); + } + @Test @TestMetadata("expectClassInJvmMultifileFacade.kt") public void testExpectClassInJvmMultifileFacade() throws Exception { diff --git a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirPsiBlackBoxCodegenTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirPsiBlackBoxCodegenTestGenerated.java index 9d0545ac9c4..804a1066d49 100644 --- a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirPsiBlackBoxCodegenTestGenerated.java +++ b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirPsiBlackBoxCodegenTestGenerated.java @@ -33727,6 +33727,12 @@ public class FirPsiBlackBoxCodegenTestGenerated extends AbstractFirPsiBlackBoxCo runTest("compiler/testData/codegen/box/multiplatform/k2/annotations/annotationsViaActualTypeAliasFromBinary.kt"); } + @Test + @TestMetadata("expectAnnotationCallInLibrary.kt") + public void testExpectAnnotationCallInLibrary() throws Exception { + runTest("compiler/testData/codegen/box/multiplatform/k2/annotations/expectAnnotationCallInLibrary.kt"); + } + @Test @TestMetadata("expectClassInJvmMultifileFacade.kt") public void testExpectClassInJvmMultifileFacade() throws Exception { diff --git a/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/actualizer/ExpectActualLinker.kt b/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/actualizer/ExpectActualLinker.kt index ba19bc4caf0..79b546dcf7d 100644 --- a/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/actualizer/ExpectActualLinker.kt +++ b/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/actualizer/ExpectActualLinker.kt @@ -84,7 +84,10 @@ internal open class ActualizerVisitor(private val symbolRemapper: SymbolRemapper declaration.also { it.transformChildren(this, null) } override fun visitFile(declaration: IrFile) = - declaration.also { it.transformChildren(this, null) } + declaration.also { + it.transformChildren(this, null) + it.transformAnnotations(declaration) + } override fun visitScript(declaration: IrScript) = declaration.also { @@ -96,6 +99,7 @@ internal open class ActualizerVisitor(private val symbolRemapper: SymbolRemapper declaration.also { it.superTypes = it.superTypes.map { superType -> superType.remapType() } it.transformChildren(this, null) + it.transformAnnotations(declaration) } override fun visitSimpleFunction(declaration: IrSimpleFunction) = (visitFunction(declaration) as IrSimpleFunction).also { @@ -110,6 +114,7 @@ internal open class ActualizerVisitor(private val symbolRemapper: SymbolRemapper declaration.also { it.returnType = it.returnType.remapType() it.transformChildren(this, null) + it.transformAnnotations(declaration) } override fun visitProperty(declaration: IrProperty) = @@ -118,12 +123,14 @@ internal open class ActualizerVisitor(private val symbolRemapper: SymbolRemapper it.overriddenSymbols = it.overriddenSymbols.memoryOptimizedMap { symbol -> symbolRemapper.getReferencedProperty(symbol) } + it.transformAnnotations(declaration) } override fun visitField(declaration: IrField) = declaration.also { it.type = it.type.remapType() it.transformChildren(this, null) + it.transformAnnotations(declaration) } override fun visitLocalDelegatedProperty(declaration: IrLocalDelegatedProperty) = @@ -133,12 +140,16 @@ internal open class ActualizerVisitor(private val symbolRemapper: SymbolRemapper } override fun visitEnumEntry(declaration: IrEnumEntry) = - declaration.also { it.transformChildren(this, null) } + declaration.also { + it.transformChildren(this, null) + it.transformAnnotations(declaration) + } override fun visitTypeParameter(declaration: IrTypeParameter) = declaration.also { it.superTypes = it.superTypes.map { superType -> superType.remapType() } it.transformChildren(this, null) + it.transformAnnotations(declaration) } override fun visitValueParameter(declaration: IrValueParameter) = @@ -146,6 +157,7 @@ internal open class ActualizerVisitor(private val symbolRemapper: SymbolRemapper it.type = it.type.remapType() it.varargElementType = it.varargElementType?.remapType() it.transformChildren(this, null) + it.transformAnnotations(declaration) } override fun visitAnonymousInitializer(declaration: IrAnonymousInitializer) = @@ -155,11 +167,13 @@ internal open class ActualizerVisitor(private val symbolRemapper: SymbolRemapper declaration.also { it.type = it.type.remapType() it.transformChildren(this, null) + it.transformAnnotations(declaration) } override fun visitTypeAlias(declaration: IrTypeAlias) = declaration.also { it.expandedType = it.expandedType.remapType() it.transformChildren(this, null) + it.transformAnnotations(declaration) } } \ No newline at end of file diff --git a/compiler/testData/codegen/box/multiplatform/k2/annotations/expectAnnotationCallInLibrary.fir.ir.txt b/compiler/testData/codegen/box/multiplatform/k2/annotations/expectAnnotationCallInLibrary.fir.ir.txt new file mode 100644 index 00000000000..a942b733114 --- /dev/null +++ b/compiler/testData/codegen/box/multiplatform/k2/annotations/expectAnnotationCallInLibrary.fir.ir.txt @@ -0,0 +1,364 @@ +Module: +FILE fqName: fileName:/common.kt + annotations: + Ann + TYPEALIAS name:TA visibility:public expandedType:kotlin.String + annotations: + Ann + CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any] + annotations: + Ann + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C.C> + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + annotations: + Ann + CONSTRUCTOR visibility:public <> () returnType:.C.C> [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any]' + FUN name:ok visibility:public modality:FINAL <> ($this:.C.C>) returnType:kotlin.String + $this: VALUE_PARAMETER name: type:.C.C> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun ok (): kotlin.String declared in .C' + CONST String type=kotlin.String value="OK" + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:f visibility:public modality:FINAL <> (p:kotlin.String) returnType:kotlin.String + annotations: + Ann + VALUE_PARAMETER name:p index:0 type:kotlin.String + annotations: + Ann + BLOCK_BODY + VAR name:localVar type:kotlin.String [var] + annotations: + Ann + GET_VAR 'p: kotlin.String declared in .f' type=kotlin.String origin=null + RETURN type=kotlin.Nothing from='public final fun f (p: kotlin.String): kotlin.String declared in ' + GET_VAR 'p: kotlin.String declared in .f' type=kotlin.String origin=null + PROPERTY name:ok visibility:public modality:FINAL [var] + FIELD PROPERTY_BACKING_FIELD name:ok type:kotlin.String visibility:private [static] + annotations: + Ann + EXPRESSION_BODY + CONST String type=kotlin.String value="OK" + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.String + annotations: + Ann + correspondingProperty: PROPERTY name:ok visibility:public modality:FINAL [var] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:ok type:kotlin.String visibility:private [static]' type=kotlin.String origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> (:kotlin.String) returnType:kotlin.Unit + annotations: + Ann + correspondingProperty: PROPERTY name:ok visibility:public modality:FINAL [var] + VALUE_PARAMETER name: index:0 type:kotlin.String + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:ok type:kotlin.String visibility:private [static]' type=kotlin.Unit origin=null + value: GET_VAR ': kotlin.String declared in .' type=kotlin.String origin=null + PROPERTY name:variable visibility:public modality:FINAL [val] + annotations: + Ann + FIELD PROPERTY_BACKING_FIELD name:variable type:kotlin.String visibility:private [final,static] + EXPRESSION_BODY + CONST String type=kotlin.String value="OK" + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.String + correspondingProperty: PROPERTY name:variable visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:variable type:kotlin.String visibility:private [final,static]' type=kotlin.String origin=null + CLASS ENUM_CLASS name:E modality:FINAL visibility:public superTypes:[kotlin.Enum<.E>] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.E + CONSTRUCTOR visibility:private <> () returnType:.E [primary] + BLOCK_BODY + ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' + : .E + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:E modality:FINAL visibility:public superTypes:[kotlin.Enum<.E>]' + ENUM_ENTRY name:OK + annotations: + Ann + init: EXPRESSION_BODY + ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .E' + FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.E> + SYNTHETIC_BODY kind=ENUM_VALUES + FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.E + VALUE_PARAMETER name:value index:0 type:kotlin.String + SYNTHETIC_BODY kind=ENUM_VALUEOF + PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] + FUN ENUM_CLASS_SPECIAL_MEMBER name: visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<.E> + correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] + SYNTHETIC_BODY kind=ENUM_ENTRIES + FUN FAKE_OVERRIDE name:clone visibility:protected modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Any [fake_override] + overridden: + protected final fun clone (): kotlin.Any declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum, other:.E) returnType:kotlin.Int [fake_override,operator] + overridden: + public final fun compareTo (other: E of kotlin.Enum): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + VALUE_PARAMETER name:other index:0 type:.E + FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public final fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Int [fake_override] + overridden: + public final fun hashCode (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + annotations: + IntrinsicConstEvaluation + overridden: + public final name: kotlin.String + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.String [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] + overridden: + public final ordinal: kotlin.Int + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Int [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + FUN FAKE_OVERRIDE name:getDeclaringClass visibility:public modality:FINAL <> ($this:kotlin.Enum) returnType:@[FlexibleNullability] java.lang.Class<@[FlexibleNullability] .E?>? [fake_override] + overridden: + public final fun getDeclaringClass (): @[FlexibleNullability] java.lang.Class<@[FlexibleNullability] E of kotlin.Enum?>? declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + FUN FAKE_OVERRIDE name:finalize visibility:protected/*protected and package*/ modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Unit [fake_override] + overridden: + protected/*protected and package*/ final fun finalize (): kotlin.Unit declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum +Module: lib +FILE fqName: fileName:/common.kt + annotations: + Ann + TYPEALIAS name:TA visibility:public expandedType:kotlin.String + annotations: + Ann + CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any] + annotations: + Ann + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C.C> + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + annotations: + Ann + CONSTRUCTOR visibility:public <> () returnType:.C.C> [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any]' + FUN name:ok visibility:public modality:FINAL <> ($this:.C.C>) returnType:kotlin.String + $this: VALUE_PARAMETER name: type:.C.C> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun ok (): kotlin.String declared in .C' + CONST String type=kotlin.String value="OK" + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:f visibility:public modality:FINAL <> (p:kotlin.String) returnType:kotlin.String + annotations: + Ann + VALUE_PARAMETER name:p index:0 type:kotlin.String + annotations: + Ann + BLOCK_BODY + VAR name:localVar type:kotlin.String [var] + annotations: + Ann + GET_VAR 'p: kotlin.String declared in .f' type=kotlin.String origin=null + RETURN type=kotlin.Nothing from='public final fun f (p: kotlin.String): kotlin.String declared in ' + GET_VAR 'p: kotlin.String declared in .f' type=kotlin.String origin=null + PROPERTY name:ok visibility:public modality:FINAL [var] + FIELD PROPERTY_BACKING_FIELD name:ok type:kotlin.String visibility:private [static] + annotations: + Ann + EXPRESSION_BODY + CONST String type=kotlin.String value="OK" + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.String + annotations: + Ann + correspondingProperty: PROPERTY name:ok visibility:public modality:FINAL [var] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:ok type:kotlin.String visibility:private [static]' type=kotlin.String origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> (:kotlin.String) returnType:kotlin.Unit + annotations: + Ann + correspondingProperty: PROPERTY name:ok visibility:public modality:FINAL [var] + VALUE_PARAMETER name: index:0 type:kotlin.String + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:ok type:kotlin.String visibility:private [static]' type=kotlin.Unit origin=null + value: GET_VAR ': kotlin.String declared in .' type=kotlin.String origin=null + PROPERTY name:variable visibility:public modality:FINAL [val] + annotations: + Ann + FIELD PROPERTY_BACKING_FIELD name:variable type:kotlin.String visibility:private [final,static] + EXPRESSION_BODY + CONST String type=kotlin.String value="OK" + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.String + correspondingProperty: PROPERTY name:variable visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:variable type:kotlin.String visibility:private [final,static]' type=kotlin.String origin=null + CLASS ENUM_CLASS name:E modality:FINAL visibility:public superTypes:[kotlin.Enum<.E>] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.E + CONSTRUCTOR visibility:private <> () returnType:.E [primary] + BLOCK_BODY + ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' + : .E + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:E modality:FINAL visibility:public superTypes:[kotlin.Enum<.E>]' + ENUM_ENTRY name:OK + annotations: + Ann + init: EXPRESSION_BODY + ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .E' + FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.E> + SYNTHETIC_BODY kind=ENUM_VALUES + FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.E + VALUE_PARAMETER name:value index:0 type:kotlin.String + SYNTHETIC_BODY kind=ENUM_VALUEOF + PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] + FUN ENUM_CLASS_SPECIAL_MEMBER name: visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<.E> + correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] + SYNTHETIC_BODY kind=ENUM_ENTRIES + FUN FAKE_OVERRIDE name:clone visibility:protected modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Any [fake_override] + overridden: + protected final fun clone (): kotlin.Any declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum, other:.E) returnType:kotlin.Int [fake_override,operator] + overridden: + public final fun compareTo (other: E of kotlin.Enum): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + VALUE_PARAMETER name:other index:0 type:.E + FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public final fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Int [fake_override] + overridden: + public final fun hashCode (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + annotations: + IntrinsicConstEvaluation + overridden: + public final name: kotlin.String + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.String [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] + overridden: + public final ordinal: kotlin.Int + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Int [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + FUN FAKE_OVERRIDE name:getDeclaringClass visibility:public modality:FINAL <> ($this:kotlin.Enum) returnType:@[FlexibleNullability] java.lang.Class<@[FlexibleNullability] .E?>? [fake_override] + overridden: + public final fun getDeclaringClass (): @[FlexibleNullability] java.lang.Class<@[FlexibleNullability] E of kotlin.Enum?>? declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum + FUN FAKE_OVERRIDE name:finalize visibility:protected/*protected and package*/ modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Unit [fake_override] + overridden: + protected/*protected and package*/ final fun finalize (): kotlin.Unit declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum +FILE fqName: fileName:/lib.kt + CLASS ANNOTATION_CLASS name:Ann modality:OPEN visibility:public superTypes:[kotlin.Annotation] + annotations: + Target(allowedTargets = [GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:FILE' type=kotlin.annotation.AnnotationTarget, GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:CLASS' type=kotlin.annotation.AnnotationTarget, GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:FUNCTION' type=kotlin.annotation.AnnotationTarget, GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:PROPERTY' type=kotlin.annotation.AnnotationTarget, GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:FIELD' type=kotlin.annotation.AnnotationTarget, GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:PROPERTY_GETTER' type=kotlin.annotation.AnnotationTarget, GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:PROPERTY_SETTER' type=kotlin.annotation.AnnotationTarget, GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:TYPE_PARAMETER' type=kotlin.annotation.AnnotationTarget, GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:VALUE_PARAMETER' type=kotlin.annotation.AnnotationTarget, GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:TYPEALIAS' type=kotlin.annotation.AnnotationTarget, GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:LOCAL_VARIABLE' type=kotlin.annotation.AnnotationTarget]) + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Ann + CONSTRUCTOR visibility:public <> () returnType:.Ann [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:Ann modality:OPEN visibility:public superTypes:[kotlin.Annotation]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Annotation + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Annotation + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in kotlin.Annotation + $this: VALUE_PARAMETER name: type:kotlin.Any +Module: main +FILE fqName: fileName:/main.kt + FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String + BLOCK_BODY + WHEN type=kotlin.Unit origin=IF + BRANCH + if: CALL 'public final fun not (): kotlin.Boolean declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ + $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ + arg0: CALL 'public final fun ok (): kotlin.String declared in .C' type=kotlin.String origin=null + $this: CONSTRUCTOR_CALL 'public constructor () declared in .C' type=.C origin=null + : kotlin.String + arg1: CONST String type=kotlin.String value="OK" + then: RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in ' + CONST String type=kotlin.String value="FAIL 1" + WHEN type=kotlin.Unit origin=IF + BRANCH + if: CALL 'public final fun not (): kotlin.Boolean declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ + $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ + arg0: CALL 'public final fun f (p: kotlin.String): kotlin.String declared in ' type=kotlin.String origin=null + p: CONST String type=kotlin.String value="OK" + arg1: CONST String type=kotlin.String value="OK" + then: RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in ' + CONST String type=kotlin.String value="FAIL 2" + WHEN type=kotlin.Unit origin=IF + BRANCH + if: CALL 'public final fun not (): kotlin.Boolean declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ + $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ + arg0: CALL 'public final fun (): kotlin.String declared in ' type=kotlin.String origin=GET_PROPERTY + arg1: CONST String type=kotlin.String value="OK" + then: RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in ' + CONST String type=kotlin.String value="FAIL 3" + WHEN type=kotlin.Unit origin=IF + BRANCH + if: CALL 'public final fun not (): kotlin.Boolean declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ + $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ + arg0: CALL 'public final fun (): kotlin.String declared in .E' type=kotlin.String origin=GET_PROPERTY + $this: GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:OK' type=.E + arg1: CONST String type=kotlin.String value="OK" + then: RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in ' + CONST String type=kotlin.String value="FAIL 4" + RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in ' + CONST String type=kotlin.String value="OK" diff --git a/compiler/testData/codegen/box/multiplatform/k2/annotations/expectAnnotationCallInLibrary.ir.txt b/compiler/testData/codegen/box/multiplatform/k2/annotations/expectAnnotationCallInLibrary.ir.txt new file mode 100644 index 00000000000..50c4d355d58 --- /dev/null +++ b/compiler/testData/codegen/box/multiplatform/k2/annotations/expectAnnotationCallInLibrary.ir.txt @@ -0,0 +1,388 @@ +Module: common +FILE fqName: fileName:/common.kt + annotations: + Ann + CLASS ANNOTATION_CLASS name:Ann modality:OPEN visibility:public [expect] superTypes:[kotlin.Annotation] + annotations: + Target(allowedTargets = [GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:FILE' type=kotlin.annotation.AnnotationTarget, GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:CLASS' type=kotlin.annotation.AnnotationTarget, GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:FUNCTION' type=kotlin.annotation.AnnotationTarget, GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:PROPERTY' type=kotlin.annotation.AnnotationTarget, GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:FIELD' type=kotlin.annotation.AnnotationTarget, GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:PROPERTY_GETTER' type=kotlin.annotation.AnnotationTarget, GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:PROPERTY_SETTER' type=kotlin.annotation.AnnotationTarget, GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:TYPE_PARAMETER' type=kotlin.annotation.AnnotationTarget, GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:VALUE_PARAMETER' type=kotlin.annotation.AnnotationTarget, GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:TYPEALIAS' type=kotlin.annotation.AnnotationTarget, GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:LOCAL_VARIABLE' type=kotlin.annotation.AnnotationTarget]) + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Ann + CONSTRUCTOR visibility:public <> () returnType:.Ann [primary,expect] + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Annotation + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Annotation + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in kotlin.Annotation + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any] + annotations: + Ann + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C.C> + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + annotations: + Ann + CONSTRUCTOR visibility:public <> () returnType:.C.C> [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any]' + FUN name:ok visibility:public modality:FINAL <> ($this:.C.C>) returnType:kotlin.String + $this: VALUE_PARAMETER name: type:.C.C> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun ok (): kotlin.String declared in .C' + CONST String type=kotlin.String value="OK" + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:f visibility:public modality:FINAL <> (p:kotlin.String) returnType:kotlin.String + annotations: + Ann + VALUE_PARAMETER name:p index:0 type:kotlin.String + annotations: + Ann + BLOCK_BODY + VAR name:localVar type:kotlin.String [var] + annotations: + Ann + GET_VAR 'p: kotlin.String declared in .f' type=kotlin.String origin=null + RETURN type=kotlin.Nothing from='public final fun f (p: kotlin.String): kotlin.String declared in ' + GET_VAR 'p: kotlin.String declared in .f' type=kotlin.String origin=null + PROPERTY name:ok visibility:public modality:FINAL [var] + FIELD PROPERTY_BACKING_FIELD name:ok type:kotlin.String visibility:private [static] + annotations: + Ann + EXPRESSION_BODY + CONST String type=kotlin.String value="OK" + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.String + annotations: + Ann + correspondingProperty: PROPERTY name:ok visibility:public modality:FINAL [var] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:ok type:kotlin.String visibility:private [static]' type=kotlin.String origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> (:kotlin.String) returnType:kotlin.Unit + annotations: + Ann + correspondingProperty: PROPERTY name:ok visibility:public modality:FINAL [var] + VALUE_PARAMETER name: index:0 type:kotlin.String + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:ok type:kotlin.String visibility:private [static]' type=kotlin.Unit origin=null + value: GET_VAR ': kotlin.String declared in .' type=kotlin.String origin=null + PROPERTY name:variable visibility:public modality:FINAL [val] + annotations: + Ann + FIELD PROPERTY_BACKING_FIELD name:variable type:kotlin.String visibility:private [final,static] + EXPRESSION_BODY + CONST String type=kotlin.String value="OK" + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.String + correspondingProperty: PROPERTY name:variable visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:variable type:kotlin.String visibility:private [final,static]' type=kotlin.String origin=null + CLASS ENUM_CLASS name:E modality:FINAL visibility:public superTypes:[kotlin.Enum<.E>] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.E + CONSTRUCTOR visibility:private <> () returnType:.E [primary] + BLOCK_BODY + ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' + : .E + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:E modality:FINAL visibility:public superTypes:[kotlin.Enum<.E>]' + ENUM_ENTRY name:OK + annotations: + Ann + init: EXPRESSION_BODY + ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .E' + PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + annotations: + IntrinsicConstEvaluation + overridden: + public final name: kotlin.String + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.E>) returnType:kotlin.String [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.E> + PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] + overridden: + public final ordinal: kotlin.Int + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.E>) returnType:kotlin.Int [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.E> + FUN FAKE_OVERRIDE name:clone visibility:protected modality:FINAL <> ($this:kotlin.Enum<.E>) returnType:kotlin.Any [fake_override] + overridden: + protected final fun clone (): kotlin.Any declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.E> + FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.E>, other:.E) returnType:kotlin.Int [fake_override,operator] + overridden: + public final fun compareTo (other: E of kotlin.Enum): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.E> + VALUE_PARAMETER name:other index:0 type:.E + FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum<.E>, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public final fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.E> + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum<.E>) returnType:kotlin.Int [fake_override] + overridden: + public final fun hashCode (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.E> + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum<.E>) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.E> + FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.E> + SYNTHETIC_BODY kind=ENUM_VALUES + FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.E + VALUE_PARAMETER name:value index:0 type:kotlin.String + SYNTHETIC_BODY kind=ENUM_VALUEOF + TYPEALIAS name:TA visibility:public expandedType:kotlin.String + annotations: + Ann +Module: lib +FILE fqName: fileName:/lib.kt + CLASS ANNOTATION_CLASS name:Ann modality:OPEN visibility:public superTypes:[kotlin.Annotation] + annotations: + Target(allowedTargets = [GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:FILE' type=kotlin.annotation.AnnotationTarget, GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:CLASS' type=kotlin.annotation.AnnotationTarget, GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:FUNCTION' type=kotlin.annotation.AnnotationTarget, GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:PROPERTY' type=kotlin.annotation.AnnotationTarget, GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:FIELD' type=kotlin.annotation.AnnotationTarget, GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:PROPERTY_GETTER' type=kotlin.annotation.AnnotationTarget, GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:PROPERTY_SETTER' type=kotlin.annotation.AnnotationTarget, GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:TYPE_PARAMETER' type=kotlin.annotation.AnnotationTarget, GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:VALUE_PARAMETER' type=kotlin.annotation.AnnotationTarget, GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:TYPEALIAS' type=kotlin.annotation.AnnotationTarget, GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:LOCAL_VARIABLE' type=kotlin.annotation.AnnotationTarget]) + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Ann + CONSTRUCTOR visibility:public <> () returnType:.Ann [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:Ann modality:OPEN visibility:public superTypes:[kotlin.Annotation]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Annotation + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Annotation + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in kotlin.Annotation + $this: VALUE_PARAMETER name: type:kotlin.Any +FILE fqName: fileName:/common.kt + annotations: + Ann + CLASS ANNOTATION_CLASS name:Ann modality:OPEN visibility:public [expect] superTypes:[kotlin.Annotation] + annotations: + Target(allowedTargets = [GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:FILE' type=kotlin.annotation.AnnotationTarget, GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:CLASS' type=kotlin.annotation.AnnotationTarget, GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:FUNCTION' type=kotlin.annotation.AnnotationTarget, GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:PROPERTY' type=kotlin.annotation.AnnotationTarget, GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:FIELD' type=kotlin.annotation.AnnotationTarget, GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:PROPERTY_GETTER' type=kotlin.annotation.AnnotationTarget, GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:PROPERTY_SETTER' type=kotlin.annotation.AnnotationTarget, GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:TYPE_PARAMETER' type=kotlin.annotation.AnnotationTarget, GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:VALUE_PARAMETER' type=kotlin.annotation.AnnotationTarget, GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:TYPEALIAS' type=kotlin.annotation.AnnotationTarget, GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:LOCAL_VARIABLE' type=kotlin.annotation.AnnotationTarget]) + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Ann + CONSTRUCTOR visibility:public <> () returnType:.Ann [primary,expect] + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Annotation + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Annotation + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in kotlin.Annotation + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any] + annotations: + Ann + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C.C> + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false + annotations: + Ann + CONSTRUCTOR visibility:public <> () returnType:.C.C> [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any]' + FUN name:ok visibility:public modality:FINAL <> ($this:.C.C>) returnType:kotlin.String + $this: VALUE_PARAMETER name: type:.C.C> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun ok (): kotlin.String declared in .C' + CONST String type=kotlin.String value="OK" + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:f visibility:public modality:FINAL <> (p:kotlin.String) returnType:kotlin.String + annotations: + Ann + VALUE_PARAMETER name:p index:0 type:kotlin.String + annotations: + Ann + BLOCK_BODY + VAR name:localVar type:kotlin.String [var] + annotations: + Ann + GET_VAR 'p: kotlin.String declared in .f' type=kotlin.String origin=null + RETURN type=kotlin.Nothing from='public final fun f (p: kotlin.String): kotlin.String declared in ' + GET_VAR 'p: kotlin.String declared in .f' type=kotlin.String origin=null + PROPERTY name:ok visibility:public modality:FINAL [var] + FIELD PROPERTY_BACKING_FIELD name:ok type:kotlin.String visibility:private [static] + annotations: + Ann + EXPRESSION_BODY + CONST String type=kotlin.String value="OK" + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.String + annotations: + Ann + correspondingProperty: PROPERTY name:ok visibility:public modality:FINAL [var] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:ok type:kotlin.String visibility:private [static]' type=kotlin.String origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> (:kotlin.String) returnType:kotlin.Unit + annotations: + Ann + correspondingProperty: PROPERTY name:ok visibility:public modality:FINAL [var] + VALUE_PARAMETER name: index:0 type:kotlin.String + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:ok type:kotlin.String visibility:private [static]' type=kotlin.Unit origin=null + value: GET_VAR ': kotlin.String declared in .' type=kotlin.String origin=null + PROPERTY name:variable visibility:public modality:FINAL [val] + annotations: + Ann + FIELD PROPERTY_BACKING_FIELD name:variable type:kotlin.String visibility:private [final,static] + EXPRESSION_BODY + CONST String type=kotlin.String value="OK" + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.String + correspondingProperty: PROPERTY name:variable visibility:public modality:FINAL [val] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:variable type:kotlin.String visibility:private [final,static]' type=kotlin.String origin=null + CLASS ENUM_CLASS name:E modality:FINAL visibility:public superTypes:[kotlin.Enum<.E>] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.E + CONSTRUCTOR visibility:private <> () returnType:.E [primary] + BLOCK_BODY + ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' + : .E + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:E modality:FINAL visibility:public superTypes:[kotlin.Enum<.E>]' + ENUM_ENTRY name:OK + annotations: + Ann + init: EXPRESSION_BODY + ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .E' + PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + annotations: + IntrinsicConstEvaluation + overridden: + public final name: kotlin.String + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.E>) returnType:kotlin.String [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.E> + PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] + overridden: + public final ordinal: kotlin.Int + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.E>) returnType:kotlin.Int [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.E> + FUN FAKE_OVERRIDE name:clone visibility:protected modality:FINAL <> ($this:kotlin.Enum<.E>) returnType:kotlin.Any [fake_override] + overridden: + protected final fun clone (): kotlin.Any declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.E> + FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.E>, other:.E) returnType:kotlin.Int [fake_override,operator] + overridden: + public final fun compareTo (other: E of kotlin.Enum): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.E> + VALUE_PARAMETER name:other index:0 type:.E + FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum<.E>, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public final fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.E> + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:finalize visibility:protected/*protected and package*/ modality:FINAL <> ($this:kotlin.Enum<.E>) returnType:kotlin.Unit [fake_override] + overridden: + protected/*protected and package*/ final fun finalize (): kotlin.Unit declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.E> + FUN FAKE_OVERRIDE name:getDeclaringClass visibility:public modality:FINAL <> ($this:kotlin.Enum<.E>) returnType:@[FlexibleNullability] java.lang.Class<@[FlexibleNullability] .E?>? [fake_override] + overridden: + public final fun getDeclaringClass (): @[FlexibleNullability] java.lang.Class<@[FlexibleNullability] E of kotlin.Enum?>? declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.E> + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum<.E>) returnType:kotlin.Int [fake_override] + overridden: + public final fun hashCode (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.E> + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum<.E>) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:kotlin.Enum<.E> + FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.E> + SYNTHETIC_BODY kind=ENUM_VALUES + FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.E + VALUE_PARAMETER name:value index:0 type:kotlin.String + SYNTHETIC_BODY kind=ENUM_VALUEOF + PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] + FUN ENUM_CLASS_SPECIAL_MEMBER name: visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<.E> + correspondingProperty: PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] + SYNTHETIC_BODY kind=ENUM_ENTRIES + TYPEALIAS name:TA visibility:public expandedType:kotlin.String + annotations: + Ann +Module: main +FILE fqName: fileName:/main.kt + FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String + BLOCK_BODY + WHEN type=kotlin.Unit origin=IF + BRANCH + if: CALL 'public final fun not (): kotlin.Boolean declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ + $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ + arg0: CALL 'public final fun ok (): kotlin.String declared in .C' type=kotlin.String origin=null + $this: CONSTRUCTOR_CALL 'public constructor () declared in .C' type=.C origin=null + : kotlin.String + arg1: CONST String type=kotlin.String value="OK" + then: RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in ' + CONST String type=kotlin.String value="FAIL 1" + WHEN type=kotlin.Unit origin=IF + BRANCH + if: CALL 'public final fun not (): kotlin.Boolean declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ + $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ + arg0: CALL 'public final fun f (p: kotlin.String): kotlin.String declared in ' type=kotlin.String origin=null + p: CONST String type=kotlin.String value="OK" + arg1: CONST String type=kotlin.String value="OK" + then: RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in ' + CONST String type=kotlin.String value="FAIL 2" + WHEN type=kotlin.Unit origin=IF + BRANCH + if: CALL 'public final fun not (): kotlin.Boolean declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ + $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ + arg0: CALL 'public final fun (): kotlin.String declared in ' type=kotlin.String origin=GET_PROPERTY + arg1: CONST String type=kotlin.String value="OK" + then: RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in ' + CONST String type=kotlin.String value="FAIL 3" + WHEN type=kotlin.Unit origin=IF + BRANCH + if: CALL 'public final fun not (): kotlin.Boolean declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ + $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ + arg0: CALL 'public final fun (): kotlin.String declared in .E' type=kotlin.String origin=GET_PROPERTY + $this: GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:OK' type=.E + arg1: CONST String type=kotlin.String value="OK" + then: RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in ' + CONST String type=kotlin.String value="FAIL 4" + RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in ' + CONST String type=kotlin.String value="OK" diff --git a/compiler/testData/codegen/box/multiplatform/k2/annotations/expectAnnotationCallInLibrary.kt b/compiler/testData/codegen/box/multiplatform/k2/annotations/expectAnnotationCallInLibrary.kt new file mode 100644 index 00000000000..31ff2fa231b --- /dev/null +++ b/compiler/testData/codegen/box/multiplatform/k2/annotations/expectAnnotationCallInLibrary.kt @@ -0,0 +1,82 @@ +// !LANGUAGE: +MultiPlatformProjects +// IGNORE_BACKEND_K1: JS, JS_IR, JS_IR_ES6, NATIVE, WASM +// ISSUE: KT-57963 + +// MODULE: common +// TARGET_PLATFORM: Common +// FILE: common.kt + +@file:Ann + +@Target( + AnnotationTarget.FILE, + AnnotationTarget.CLASS, + AnnotationTarget.FUNCTION, + AnnotationTarget.PROPERTY, + AnnotationTarget.FIELD, + AnnotationTarget.PROPERTY_GETTER, + AnnotationTarget.PROPERTY_SETTER, + AnnotationTarget.TYPE_PARAMETER, + AnnotationTarget.VALUE_PARAMETER, + AnnotationTarget.TYPEALIAS, + AnnotationTarget.LOCAL_VARIABLE +) +expect annotation class Ann constructor() + +@Ann +class C<@Ann T> { + fun ok() = "OK" +} + +@Ann +fun f(@Ann p: TA): TA { + @Ann + var localVar = p + return p +} + +@field:Ann +@get:Ann +@set:Ann +var ok = "OK" + +@Ann +val variable = "OK" + +enum class E { + @Ann + OK +} + +@Ann +typealias TA = String + +// MODULE: lib()()(common) +// FILE: lib.kt + +@Target( + AnnotationTarget.FILE, + AnnotationTarget.CLASS, + AnnotationTarget.FUNCTION, + AnnotationTarget.PROPERTY, + AnnotationTarget.FIELD, + AnnotationTarget.PROPERTY_GETTER, + AnnotationTarget.PROPERTY_SETTER, + AnnotationTarget.TYPE_PARAMETER, + AnnotationTarget.VALUE_PARAMETER, + AnnotationTarget.TYPEALIAS, + AnnotationTarget.LOCAL_VARIABLE +) +actual annotation class Ann + +// MODULE: main(lib) +// FILE: main.kt + +fun box(): String { + if (C().ok() != "OK") return "FAIL 1" + if (f("OK") != "OK") return "FAIL 2" + if (ok != "OK") return "FAIL 3" + if (E.OK.name != "OK") return "FAIL 4" + + return "OK" +} \ No newline at end of file diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java index 67bf801b736..95b2407b6a8 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java @@ -32071,6 +32071,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { runTest("compiler/testData/codegen/box/multiplatform/k2/annotations/annotationsViaActualTypeAliasFromBinary.kt"); } + @Test + @TestMetadata("expectAnnotationCallInLibrary.kt") + public void testExpectAnnotationCallInLibrary() throws Exception { + runTest("compiler/testData/codegen/box/multiplatform/k2/annotations/expectAnnotationCallInLibrary.kt"); + } + @Test @TestMetadata("expectClassInJvmMultifileFacade.kt") public void testExpectClassInJvmMultifileFacade() throws Exception { diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java index 7dc9e27a96f..c9812c60f02 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java @@ -33727,6 +33727,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes runTest("compiler/testData/codegen/box/multiplatform/k2/annotations/annotationsViaActualTypeAliasFromBinary.kt"); } + @Test + @TestMetadata("expectAnnotationCallInLibrary.kt") + public void testExpectAnnotationCallInLibrary() throws Exception { + runTest("compiler/testData/codegen/box/multiplatform/k2/annotations/expectAnnotationCallInLibrary.kt"); + } + @Test @TestMetadata("expectClassInJvmMultifileFacade.kt") public void testExpectClassInJvmMultifileFacade() throws Exception { diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenWithIrInlinerTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenWithIrInlinerTestGenerated.java index de8e6e260b8..08cc6582473 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenWithIrInlinerTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenWithIrInlinerTestGenerated.java @@ -33727,6 +33727,12 @@ public class IrBlackBoxCodegenWithIrInlinerTestGenerated extends AbstractIrBlack runTest("compiler/testData/codegen/box/multiplatform/k2/annotations/annotationsViaActualTypeAliasFromBinary.kt"); } + @Test + @TestMetadata("expectAnnotationCallInLibrary.kt") + public void testExpectAnnotationCallInLibrary() throws Exception { + runTest("compiler/testData/codegen/box/multiplatform/k2/annotations/expectAnnotationCallInLibrary.kt"); + } + @Test @TestMetadata("expectClassInJvmMultifileFacade.kt") public void testExpectClassInJvmMultifileFacade() throws Exception { diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java index db3f25e6637..880e14e40e8 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java @@ -28751,6 +28751,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes public void testAllFilesPresentInAnnotations() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/multiplatform/k2/annotations"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + + @TestMetadata("expectAnnotationCallInLibrary.kt") + public void testExpectAnnotationCallInLibrary() throws Exception { + runTest("compiler/testData/codegen/box/multiplatform/k2/annotations/expectAnnotationCallInLibrary.kt"); + } } @TestMetadata("compiler/testData/codegen/box/multiplatform/k2/basic") diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirJsCodegenBoxTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirJsCodegenBoxTestGenerated.java index fdedbba9f04..f21e5421c1a 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirJsCodegenBoxTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirJsCodegenBoxTestGenerated.java @@ -23545,6 +23545,12 @@ public class FirJsCodegenBoxTestGenerated extends AbstractFirJsCodegenBoxTest { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/multiplatform/k2/annotations"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR, true); } + @Test + @TestMetadata("expectAnnotationCallInLibrary.kt") + public void testExpectAnnotationCallInLibrary() throws Exception { + runTest("compiler/testData/codegen/box/multiplatform/k2/annotations/expectAnnotationCallInLibrary.kt"); + } + @Test @TestMetadata("optionalExpectation.kt") public void testOptionalExpectation() throws Exception { diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirJsES6CodegenBoxTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirJsES6CodegenBoxTestGenerated.java index 0c55f4547bb..7c77104c954 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirJsES6CodegenBoxTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirJsES6CodegenBoxTestGenerated.java @@ -23545,6 +23545,12 @@ public class FirJsES6CodegenBoxTestGenerated extends AbstractFirJsES6CodegenBoxT KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/multiplatform/k2/annotations"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true); } + @Test + @TestMetadata("expectAnnotationCallInLibrary.kt") + public void testExpectAnnotationCallInLibrary() throws Exception { + runTest("compiler/testData/codegen/box/multiplatform/k2/annotations/expectAnnotationCallInLibrary.kt"); + } + @Test @TestMetadata("optionalExpectation.kt") public void testOptionalExpectation() throws Exception { diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsCodegenBoxTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsCodegenBoxTestGenerated.java index a974737e91b..66f8b174c7e 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsCodegenBoxTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsCodegenBoxTestGenerated.java @@ -23545,6 +23545,12 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/multiplatform/k2/annotations"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR, true); } + @Test + @TestMetadata("expectAnnotationCallInLibrary.kt") + public void testExpectAnnotationCallInLibrary() throws Exception { + runTest("compiler/testData/codegen/box/multiplatform/k2/annotations/expectAnnotationCallInLibrary.kt"); + } + @Test @TestMetadata("optionalExpectation.kt") public void testOptionalExpectation() throws Exception { diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsES6CodegenBoxTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsES6CodegenBoxTestGenerated.java index 754a0700a72..c760806f775 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsES6CodegenBoxTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsES6CodegenBoxTestGenerated.java @@ -23545,6 +23545,12 @@ public class IrJsES6CodegenBoxTestGenerated extends AbstractIrJsES6CodegenBoxTes KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/multiplatform/k2/annotations"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true); } + @Test + @TestMetadata("expectAnnotationCallInLibrary.kt") + public void testExpectAnnotationCallInLibrary() throws Exception { + runTest("compiler/testData/codegen/box/multiplatform/k2/annotations/expectAnnotationCallInLibrary.kt"); + } + @Test @TestMetadata("optionalExpectation.kt") public void testOptionalExpectation() throws Exception { diff --git a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/FirNativeCodegenBoxTestGenerated.java b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/FirNativeCodegenBoxTestGenerated.java index b605792dd5a..2b0225e69f6 100644 --- a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/FirNativeCodegenBoxTestGenerated.java +++ b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/FirNativeCodegenBoxTestGenerated.java @@ -26511,6 +26511,12 @@ public class FirNativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTe KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/multiplatform/k2/annotations"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.NATIVE, true); } + @Test + @TestMetadata("expectAnnotationCallInLibrary.kt") + public void testExpectAnnotationCallInLibrary() throws Exception { + runTest("compiler/testData/codegen/box/multiplatform/k2/annotations/expectAnnotationCallInLibrary.kt"); + } + @Test @TestMetadata("optionalExpectation.kt") public void testOptionalExpectation() throws Exception { diff --git a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/FirNativeCodegenBoxTestNoPLGenerated.java b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/FirNativeCodegenBoxTestNoPLGenerated.java index 411a33a95a5..fa4bde2d1e0 100644 --- a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/FirNativeCodegenBoxTestNoPLGenerated.java +++ b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/FirNativeCodegenBoxTestNoPLGenerated.java @@ -27125,6 +27125,12 @@ public class FirNativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenB KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/multiplatform/k2/annotations"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.NATIVE, true); } + @Test + @TestMetadata("expectAnnotationCallInLibrary.kt") + public void testExpectAnnotationCallInLibrary() throws Exception { + runTest("compiler/testData/codegen/box/multiplatform/k2/annotations/expectAnnotationCallInLibrary.kt"); + } + @Test @TestMetadata("optionalExpectation.kt") public void testOptionalExpectation() throws Exception { diff --git a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/NativeCodegenBoxTestGenerated.java b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/NativeCodegenBoxTestGenerated.java index 7bd26b4ae81..12bf012e647 100644 --- a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/NativeCodegenBoxTestGenerated.java +++ b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/NativeCodegenBoxTestGenerated.java @@ -26205,6 +26205,12 @@ public class NativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTest KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/multiplatform/k2/annotations"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.NATIVE, true); } + @Test + @TestMetadata("expectAnnotationCallInLibrary.kt") + public void testExpectAnnotationCallInLibrary() throws Exception { + runTest("compiler/testData/codegen/box/multiplatform/k2/annotations/expectAnnotationCallInLibrary.kt"); + } + @Test @TestMetadata("optionalExpectation.kt") public void testOptionalExpectation() throws Exception { diff --git a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/NativeCodegenBoxTestNoPLGenerated.java b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/NativeCodegenBoxTestNoPLGenerated.java index 8b669eaf5da..bcc794afa25 100644 --- a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/NativeCodegenBoxTestNoPLGenerated.java +++ b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/NativeCodegenBoxTestNoPLGenerated.java @@ -26512,6 +26512,12 @@ public class NativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenBoxT KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/multiplatform/k2/annotations"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.NATIVE, true); } + @Test + @TestMetadata("expectAnnotationCallInLibrary.kt") + public void testExpectAnnotationCallInLibrary() throws Exception { + runTest("compiler/testData/codegen/box/multiplatform/k2/annotations/expectAnnotationCallInLibrary.kt"); + } + @Test @TestMetadata("optionalExpectation.kt") public void testOptionalExpectation() throws Exception { diff --git a/wasm/wasm.tests/tests-gen/org/jetbrains/kotlin/wasm/test/FirWasmCodegenBoxTestGenerated.java b/wasm/wasm.tests/tests-gen/org/jetbrains/kotlin/wasm/test/FirWasmCodegenBoxTestGenerated.java index b1a31e057fb..ef6ec429e50 100644 --- a/wasm/wasm.tests/tests-gen/org/jetbrains/kotlin/wasm/test/FirWasmCodegenBoxTestGenerated.java +++ b/wasm/wasm.tests/tests-gen/org/jetbrains/kotlin/wasm/test/FirWasmCodegenBoxTestGenerated.java @@ -23293,6 +23293,12 @@ public class FirWasmCodegenBoxTestGenerated extends AbstractFirWasmCodegenBoxTes KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/multiplatform/k2/annotations"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.WASM, true); } + @Test + @TestMetadata("expectAnnotationCallInLibrary.kt") + public void testExpectAnnotationCallInLibrary() throws Exception { + runTest("compiler/testData/codegen/box/multiplatform/k2/annotations/expectAnnotationCallInLibrary.kt"); + } + @Test @TestMetadata("optionalExpectation.kt") public void testOptionalExpectation() throws Exception { diff --git a/wasm/wasm.tests/tests-gen/org/jetbrains/kotlin/wasm/test/K1WasmCodegenBoxTestGenerated.java b/wasm/wasm.tests/tests-gen/org/jetbrains/kotlin/wasm/test/K1WasmCodegenBoxTestGenerated.java index 09f8d445673..a1b45008c40 100644 --- a/wasm/wasm.tests/tests-gen/org/jetbrains/kotlin/wasm/test/K1WasmCodegenBoxTestGenerated.java +++ b/wasm/wasm.tests/tests-gen/org/jetbrains/kotlin/wasm/test/K1WasmCodegenBoxTestGenerated.java @@ -23293,6 +23293,12 @@ public class K1WasmCodegenBoxTestGenerated extends AbstractK1WasmCodegenBoxTest KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/multiplatform/k2/annotations"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.WASM, true); } + @Test + @TestMetadata("expectAnnotationCallInLibrary.kt") + public void testExpectAnnotationCallInLibrary() throws Exception { + runTest("compiler/testData/codegen/box/multiplatform/k2/annotations/expectAnnotationCallInLibrary.kt"); + } + @Test @TestMetadata("optionalExpectation.kt") public void testOptionalExpectation() throws Exception {