diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/ClassMemberGenerator.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/ClassMemberGenerator.kt index 8d23a415a1f..3cbc34820ac 100644 --- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/ClassMemberGenerator.kt +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/ClassMemberGenerator.kt @@ -100,6 +100,9 @@ internal class ClassMemberGenerator( } for ((valueParameter, firValueParameter) in valueParameters.zip(firFunction.valueParameters)) { valueParameter.setDefaultValue(firValueParameter) + valueParameter.annotations = firValueParameter.annotations.mapNotNull { + it.accept(visitor, null) as? IrConstructorCall + } } annotations = firFunction.annotations.mapNotNull { it.accept(visitor, null) as? IrConstructorCall diff --git a/compiler/testData/codegen/box/annotations/annotatedLambda/funExpression.kt b/compiler/testData/codegen/box/annotations/annotatedLambda/funExpression.kt index dc141f92f08..d95c12c6292 100644 --- a/compiler/testData/codegen/box/annotations/annotatedLambda/funExpression.kt +++ b/compiler/testData/codegen/box/annotations/annotatedLambda/funExpression.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM // WITH_RUNTIME diff --git a/compiler/testData/codegen/box/annotations/parameterAnnotationInDefaultImpls.kt b/compiler/testData/codegen/box/annotations/parameterAnnotationInDefaultImpls.kt index d3812943f63..ce9137b8840 100644 --- a/compiler/testData/codegen/box/annotations/parameterAnnotationInDefaultImpls.kt +++ b/compiler/testData/codegen/box/annotations/parameterAnnotationInDefaultImpls.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // SKIP_JDK6 // TARGET_BACKEND: JVM // FULL_JDK diff --git a/compiler/testData/codegen/box/reflection/annotations/localClassParameterAnnotation.kt b/compiler/testData/codegen/box/reflection/annotations/localClassParameterAnnotation.kt index f6a733b3beb..f5bd92fd349 100644 --- a/compiler/testData/codegen/box/reflection/annotations/localClassParameterAnnotation.kt +++ b/compiler/testData/codegen/box/reflection/annotations/localClassParameterAnnotation.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS_IR // TODO: muted automatically, investigate should it be ran for JS or not // IGNORE_BACKEND: JS, NATIVE diff --git a/compiler/testData/codegen/box/reflection/annotations/propertyAccessors.kt b/compiler/testData/codegen/box/reflection/annotations/propertyAccessors.kt index 06c9a6833ac..068d47125ac 100644 --- a/compiler/testData/codegen/box/reflection/annotations/propertyAccessors.kt +++ b/compiler/testData/codegen/box/reflection/annotations/propertyAccessors.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS_IR // TODO: muted automatically, investigate should it be ran for JS or not // IGNORE_BACKEND: JS, NATIVE diff --git a/compiler/testData/codegen/box/reflection/annotations/simpleParamAnnotation.kt b/compiler/testData/codegen/box/reflection/annotations/simpleParamAnnotation.kt index 4e6929ea030..6e642f79c54 100644 --- a/compiler/testData/codegen/box/reflection/annotations/simpleParamAnnotation.kt +++ b/compiler/testData/codegen/box/reflection/annotations/simpleParamAnnotation.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS_IR // TODO: muted automatically, investigate should it be ran for JS or not // IGNORE_BACKEND: JS, NATIVE diff --git a/compiler/testData/ir/irText/declarations/annotations/primaryConstructorParameterWithAnnotations.fir.txt b/compiler/testData/ir/irText/declarations/annotations/primaryConstructorParameterWithAnnotations.fir.txt index 599a72694d7..cf997e5d582 100644 --- a/compiler/testData/ir/irText/declarations/annotations/primaryConstructorParameterWithAnnotations.fir.txt +++ b/compiler/testData/ir/irText/declarations/annotations/primaryConstructorParameterWithAnnotations.fir.txt @@ -19,6 +19,8 @@ FILE fqName: fileName:/primaryConstructorParameterWithAnnotations.kt $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test CONSTRUCTOR visibility:public <> (x:kotlin.Int) returnType:.Test [primary] VALUE_PARAMETER name:x index:0 type:kotlin.Int + annotations: + Ann BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test modality:FINAL visibility:public superTypes:[kotlin.Any]' diff --git a/compiler/testData/ir/irText/declarations/annotations/propertyAccessorsFromClassHeaderWithAnnotations.fir.txt b/compiler/testData/ir/irText/declarations/annotations/propertyAccessorsFromClassHeaderWithAnnotations.fir.txt index f0e66fe474e..c2b84fc759e 100644 --- a/compiler/testData/ir/irText/declarations/annotations/propertyAccessorsFromClassHeaderWithAnnotations.fir.txt +++ b/compiler/testData/ir/irText/declarations/annotations/propertyAccessorsFromClassHeaderWithAnnotations.fir.txt @@ -31,7 +31,12 @@ FILE fqName: fileName:/propertyAccessorsFromClassHeaderWithAnnotations.kt $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C CONSTRUCTOR visibility:public <> (x:kotlin.Int, y:kotlin.Int) returnType:.C [primary] VALUE_PARAMETER name:x index:0 type:kotlin.Int + annotations: + A(x = 'C.x.get') VALUE_PARAMETER name:y index:1 type:kotlin.Int + annotations: + A(x = 'C.y.get') + A(x = 'C.y.set') BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any]' diff --git a/compiler/testData/ir/irText/declarations/annotations/propertySetterParameterWithAnnotations.fir.txt b/compiler/testData/ir/irText/declarations/annotations/propertySetterParameterWithAnnotations.fir.txt index 4c9eb2e6345..93fe3ccf2f3 100644 --- a/compiler/testData/ir/irText/declarations/annotations/propertySetterParameterWithAnnotations.fir.txt +++ b/compiler/testData/ir/irText/declarations/annotations/propertySetterParameterWithAnnotations.fir.txt @@ -36,6 +36,8 @@ FILE fqName: fileName:/propertySetterParameterWithAnnotations.kt $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C CONSTRUCTOR visibility:public <> (p:kotlin.Int) returnType:.C [primary] VALUE_PARAMETER name:p index:0 type:kotlin.Int + annotations: + AnnParam BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any]' diff --git a/compiler/testData/ir/irText/declarations/annotations/valueParametersWithAnnotations.fir.txt b/compiler/testData/ir/irText/declarations/annotations/valueParametersWithAnnotations.fir.txt index 95adabf5e17..f49c36e3736 100644 --- a/compiler/testData/ir/irText/declarations/annotations/valueParametersWithAnnotations.fir.txt +++ b/compiler/testData/ir/irText/declarations/annotations/valueParametersWithAnnotations.fir.txt @@ -29,11 +29,15 @@ FILE fqName: fileName:/valueParametersWithAnnotations.kt $this: VALUE_PARAMETER name: type:kotlin.Any FUN name:testFun visibility:public modality:FINAL <> (x:kotlin.Int) returnType:kotlin.Unit VALUE_PARAMETER name:x index:0 type:kotlin.Int + annotations: + TestAnn(x = 'testFun.x') BLOCK_BODY CLASS CLASS name:TestClassConstructor1 modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestClassConstructor1 CONSTRUCTOR visibility:public <> (x:kotlin.Int) returnType:.TestClassConstructor1 [primary] VALUE_PARAMETER name:x index:0 type:kotlin.Int + annotations: + TestAnn(x = 'TestClassConstructor1.x') BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestClassConstructor1 modality:FINAL visibility:public superTypes:[kotlin.Any]' diff --git a/compiler/testData/ir/irText/expressions/signedToUnsignedConversions_test.fir.txt b/compiler/testData/ir/irText/expressions/signedToUnsignedConversions_test.fir.txt index f11054cf25b..6a3dce65eb7 100644 --- a/compiler/testData/ir/irText/expressions/signedToUnsignedConversions_test.fir.txt +++ b/compiler/testData/ir/irText/expressions/signedToUnsignedConversions_test.fir.txt @@ -67,21 +67,33 @@ FILE fqName: fileName:/signedToUnsignedConversions_test.kt GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:UINT_CONST type:kotlin.UInt visibility:public [final,static]' type=kotlin.UInt origin=null FUN name:takeUByte visibility:public modality:FINAL <> (u:kotlin.UByte) returnType:kotlin.Unit VALUE_PARAMETER name:u index:0 type:kotlin.UByte + annotations: + ImplicitIntegerCoercion BLOCK_BODY FUN name:takeUShort visibility:public modality:FINAL <> (u:kotlin.UShort) returnType:kotlin.Unit VALUE_PARAMETER name:u index:0 type:kotlin.UShort + annotations: + ImplicitIntegerCoercion BLOCK_BODY FUN name:takeUInt visibility:public modality:FINAL <> (u:kotlin.UInt) returnType:kotlin.Unit VALUE_PARAMETER name:u index:0 type:kotlin.UInt + annotations: + ImplicitIntegerCoercion BLOCK_BODY FUN name:takeULong visibility:public modality:FINAL <> (u:kotlin.ULong) returnType:kotlin.Unit VALUE_PARAMETER name:u index:0 type:kotlin.ULong + annotations: + ImplicitIntegerCoercion BLOCK_BODY FUN name:takeUBytes visibility:public modality:FINAL <> (u:kotlin.UByteArray) returnType:kotlin.Unit VALUE_PARAMETER name:u index:0 type:kotlin.UByteArray varargElementType:kotlin.UByte [vararg] + annotations: + ImplicitIntegerCoercion BLOCK_BODY FUN name:takeLong visibility:public modality:FINAL <> (l:kotlin.Long) returnType:kotlin.Unit VALUE_PARAMETER name:l index:0 type:kotlin.Long + annotations: + ImplicitIntegerCoercion BLOCK_BODY FUN name:test visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY diff --git a/compiler/testData/ir/irText/types/castsInsideCoroutineInference.fir.txt b/compiler/testData/ir/irText/types/castsInsideCoroutineInference.fir.txt index 43421fbae05..b8b88a92610 100644 --- a/compiler/testData/ir/irText/types/castsInsideCoroutineInference.fir.txt +++ b/compiler/testData/ir/irText/types/castsInsideCoroutineInference.fir.txt @@ -4,6 +4,8 @@ FILE fqName: fileName:/castsInsideCoroutineInference.kt OptIn(markerClass = CLASS_REFERENCE 'CLASS IR_EXTERNAL_DECLARATION_STUB ANNOTATION_CLASS name:ExperimentalTypeInference modality:FINAL visibility:public superTypes:[kotlin.Annotation]' type=kotlin.reflect.KClass) TYPE_PARAMETER name:R index:0 variance: superTypes:[kotlin.Any?] VALUE_PARAMETER name:block index:0 type:kotlin.coroutines.SuspendFunction2<.CoroutineScope, .FlowCollector.scopedFlow>, kotlin.Unit> + annotations: + BuilderInference BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun scopedFlow (block: kotlin.coroutines.SuspendFunction2<.CoroutineScope, .FlowCollector.scopedFlow>, kotlin.Unit>): .Flow.scopedFlow> declared in ' CALL 'public final fun flow (block: kotlin.coroutines.SuspendFunction1<.FlowCollector.flow>, kotlin.Unit>): .Flow.flow> declared in ' type=.Flow.scopedFlow> origin=null @@ -54,6 +56,8 @@ FILE fqName: fileName:/castsInsideCoroutineInference.kt OptIn(markerClass = CLASS_REFERENCE 'CLASS IR_EXTERNAL_DECLARATION_STUB ANNOTATION_CLASS name:ExperimentalTypeInference modality:FINAL visibility:public superTypes:[kotlin.Annotation]' type=kotlin.reflect.KClass) TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] VALUE_PARAMETER name:block index:0 type:kotlin.coroutines.SuspendFunction1<.FlowCollector.unsafeFlow>, kotlin.Unit> [crossinline] + annotations: + BuilderInference BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun unsafeFlow (block: kotlin.coroutines.SuspendFunction1<.FlowCollector.unsafeFlow>, kotlin.Unit>): .Flow.unsafeFlow> [inline] declared in ' CALL 'public final fun TODO (): kotlin.Nothing [inline] declared in kotlin' type=kotlin.Nothing origin=null @@ -186,6 +190,8 @@ FILE fqName: fileName:/castsInsideCoroutineInference.kt OptIn(markerClass = CLASS_REFERENCE 'CLASS IR_EXTERNAL_DECLARATION_STUB ANNOTATION_CLASS name:ExperimentalTypeInference modality:FINAL visibility:public superTypes:[kotlin.Annotation]' type=kotlin.reflect.KClass) TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] VALUE_PARAMETER name:block index:0 type:kotlin.coroutines.SuspendFunction1<.FlowCollector.flow>, kotlin.Unit> + annotations: + BuilderInference BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun flow (block: kotlin.coroutines.SuspendFunction1<.FlowCollector.flow>, kotlin.Unit>): .Flow.flow> declared in ' CALL 'public final fun TODO (): kotlin.Nothing [inline] declared in kotlin' type=kotlin.Nothing origin=null @@ -194,6 +200,8 @@ FILE fqName: fileName:/castsInsideCoroutineInference.kt OptIn(markerClass = CLASS_REFERENCE 'CLASS IR_EXTERNAL_DECLARATION_STUB ANNOTATION_CLASS name:ExperimentalTypeInference modality:FINAL visibility:public superTypes:[kotlin.Annotation]' type=kotlin.reflect.KClass) TYPE_PARAMETER name:R index:0 variance: superTypes:[kotlin.Any?] VALUE_PARAMETER name:block index:0 type:kotlin.coroutines.SuspendFunction1<.CoroutineScope, R of .flowScope> + annotations: + BuilderInference BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun flowScope (block: kotlin.coroutines.SuspendFunction1<.CoroutineScope, R of .flowScope>): R of .flowScope [suspend] declared in ' CALL 'public final fun TODO (): kotlin.Nothing [inline] declared in kotlin' type=kotlin.Nothing origin=null @@ -301,6 +309,8 @@ FILE fqName: fileName:/castsInsideCoroutineInference.kt TYPE_PARAMETER name:E index:0 variance: superTypes:[kotlin.Any?] $receiver: VALUE_PARAMETER name: type:.CoroutineScope VALUE_PARAMETER name:block index:0 type:kotlin.coroutines.SuspendFunction1<.ProducerScope.produce>, kotlin.Unit> + annotations: + BuilderInference BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun produce (block: kotlin.coroutines.SuspendFunction1<.ProducerScope.produce>, kotlin.Unit>): .ReceiveChannel.produce> declared in ' CALL 'public final fun TODO (): kotlin.Nothing [inline] declared in kotlin' type=kotlin.Nothing origin=null