From 648c1f45992c67f043f153e376cb24a044d1cfb8 Mon Sep 17 00:00:00 2001 From: Leonid Startsev Date: Thu, 13 Jul 2023 12:29:36 +0200 Subject: [PATCH] Support instantiation of annotations with type parameters By ignoring type parameters. Since type parameters in annotations are a very limited feature, their sole use is to be able to specify them as KClass argument: annotation class Foo(val bar: KClass). Since we can encounter type param only as a KClass type argument (and never as a property type), simple approach of ignoring them works fine. In that case, since we simply copy property types to synthetic implementation class, its properties in IR start look like this: annotation class FooImpl(override val bar: KClass). This IR seems to be not completely correct, since FooImpl.bar type contains T of Foo param, which is out of its scope. However, so far I didn't encounter any problems with this during testing and after MR discussion this approach has been considered possible. #KT-59558 Fixed #KT-59036 Fixed --- .../expression/FirConstructorCallChecker.kt | 4 +- ...LightTreeBlackBoxCodegenTestGenerated.java | 18 +++++++++ .../FirPsiBlackBoxCodegenTestGenerated.java | 18 +++++++++ .../resolve/calls/CallExpressionResolver.kt | 2 +- .../AnnotationImplementationTransformer.kt | 2 +- .../instances/annotationInstances.kt | 2 +- .../instances/annotationWithTypeParameters.kt | 38 +++++++++++++++++++ .../annotationWithTypeParametersJvm.kt | 36 ++++++++++++++++++ .../instances/multimoduleTypeParams.kt | 36 ++++++++++++++++++ .../annotations/ConstructorCallAllowed.kt | 2 +- .../codegen/BlackBoxCodegenTestGenerated.java | 12 ++++++ .../IrBlackBoxCodegenTestGenerated.java | 18 +++++++++ ...kBoxCodegenWithIrInlinerTestGenerated.java | 18 +++++++++ .../LightAnalysisModeTestGenerated.java | 15 ++++++++ .../fir/FirJsCodegenBoxTestGenerated.java | 12 ++++++ .../test/ir/IrJsCodegenBoxTestGenerated.java | 12 ++++++ .../ir/IrJsES6CodegenBoxTestGenerated.java | 12 ++++++ .../FirNativeCodegenBoxTestGenerated.java | 12 ++++++ .../FirNativeCodegenBoxTestNoPLGenerated.java | 12 ++++++ .../NativeCodegenBoxTestGenerated.java | 12 ++++++ .../NativeCodegenBoxTestNoPLGenerated.java | 12 ++++++ .../test/FirWasmCodegenBoxTestGenerated.java | 12 ++++++ .../test/K1WasmCodegenBoxTestGenerated.java | 12 ++++++ 23 files changed, 322 insertions(+), 7 deletions(-) create mode 100644 compiler/testData/codegen/box/annotations/instances/annotationWithTypeParameters.kt create mode 100644 compiler/testData/codegen/box/annotations/instances/annotationWithTypeParametersJvm.kt create mode 100644 compiler/testData/codegen/box/annotations/instances/multimoduleTypeParams.kt diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/expression/FirConstructorCallChecker.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/expression/FirConstructorCallChecker.kt index 1e9eabd5e6e..41e8175d291 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/expression/FirConstructorCallChecker.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/expression/FirConstructorCallChecker.kt @@ -32,9 +32,7 @@ object FirConstructorCallChecker : FirFunctionCallChecker() { klass !is FirRegularClass || klass.classKind != ClassKind.ANNOTATION_CLASS } ) { - if (!context.languageVersionSettings.supportsFeature(LanguageFeature.InstantiationOfAnnotationClasses) || - declarationClass.typeParameterSymbols.isNotEmpty() - ) reporter.reportOn( + if (!context.languageVersionSettings.supportsFeature(LanguageFeature.InstantiationOfAnnotationClasses)) reporter.reportOn( expression.source, FirErrors.ANNOTATION_CLASS_CONSTRUCTOR_CALL, context 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 feeac1af083..1a5092435e6 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 @@ -546,6 +546,18 @@ public class FirLightTreeBlackBoxCodegenTestGenerated extends AbstractFirLightTr runTest("compiler/testData/codegen/box/annotations/instances/annotationType.kt"); } + @Test + @TestMetadata("annotationWithTypeParameters.kt") + public void testAnnotationWithTypeParameters() throws Exception { + runTest("compiler/testData/codegen/box/annotations/instances/annotationWithTypeParameters.kt"); + } + + @Test + @TestMetadata("annotationWithTypeParametersJvm.kt") + public void testAnnotationWithTypeParametersJvm() throws Exception { + runTest("compiler/testData/codegen/box/annotations/instances/annotationWithTypeParametersJvm.kt"); + } + @Test @TestMetadata("annotationsUnsignedTypes.kt") public void testAnnotationsUnsignedTypes() throws Exception { @@ -594,6 +606,12 @@ public class FirLightTreeBlackBoxCodegenTestGenerated extends AbstractFirLightTr runTest("compiler/testData/codegen/box/annotations/instances/multimoduleInlining.kt"); } + @Test + @TestMetadata("multimoduleTypeParams.kt") + public void testMultimoduleTypeParams() throws Exception { + runTest("compiler/testData/codegen/box/annotations/instances/multimoduleTypeParams.kt"); + } + @Test @TestMetadata("multiplatformInstantiation.kt") public void testMultiplatformInstantiation() 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 a88428b6537..dcbae359e18 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 @@ -546,6 +546,18 @@ public class FirPsiBlackBoxCodegenTestGenerated extends AbstractFirPsiBlackBoxCo runTest("compiler/testData/codegen/box/annotations/instances/annotationType.kt"); } + @Test + @TestMetadata("annotationWithTypeParameters.kt") + public void testAnnotationWithTypeParameters() throws Exception { + runTest("compiler/testData/codegen/box/annotations/instances/annotationWithTypeParameters.kt"); + } + + @Test + @TestMetadata("annotationWithTypeParametersJvm.kt") + public void testAnnotationWithTypeParametersJvm() throws Exception { + runTest("compiler/testData/codegen/box/annotations/instances/annotationWithTypeParametersJvm.kt"); + } + @Test @TestMetadata("annotationsUnsignedTypes.kt") public void testAnnotationsUnsignedTypes() throws Exception { @@ -594,6 +606,12 @@ public class FirPsiBlackBoxCodegenTestGenerated extends AbstractFirPsiBlackBoxCo runTest("compiler/testData/codegen/box/annotations/instances/multimoduleInlining.kt"); } + @Test + @TestMetadata("multimoduleTypeParams.kt") + public void testMultimoduleTypeParams() throws Exception { + runTest("compiler/testData/codegen/box/annotations/instances/multimoduleTypeParams.kt"); + } + @Test @TestMetadata("multiplatformInstantiation.kt") public void testMultiplatformInstantiation() throws Exception { diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/CallExpressionResolver.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/CallExpressionResolver.kt index 94f3005d160..2b616ad7a93 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/CallExpressionResolver.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/CallExpressionResolver.kt @@ -225,7 +225,7 @@ class CallExpressionResolver( if (functionDescriptor is ConstructorDescriptor) { val constructedClass = functionDescriptor.constructedClass if (DescriptorUtils.isAnnotationClass(constructedClass) && !canInstantiateAnnotationClass(callExpression, context.trace)) { - val supported = context.languageVersionSettings.supportsFeature(LanguageFeature.InstantiationOfAnnotationClasses) && constructedClass.declaredTypeParameters.isEmpty() + val supported = context.languageVersionSettings.supportsFeature(LanguageFeature.InstantiationOfAnnotationClasses) if (!supported) context.trace.report(ANNOTATION_CLASS_CONSTRUCTOR_CALL.on(callExpression)) } if (DescriptorUtils.isEnumClass(constructedClass)) { diff --git a/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/lower/AnnotationImplementationTransformer.kt b/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/lower/AnnotationImplementationTransformer.kt index 7364ca95515..0a53fd84a0b 100644 --- a/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/lower/AnnotationImplementationTransformer.kt +++ b/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/lower/AnnotationImplementationTransformer.kt @@ -79,7 +79,6 @@ abstract class AnnotationImplementationTransformer(val context: BackendContext, override fun visitConstructorCall(expression: IrConstructorCall): IrExpression { val constructedClass = expression.type.classOrNull?.owner ?: return super.visitConstructorCall(expression) if (!constructedClass.isAnnotationClass) return super.visitConstructorCall(expression) - if (constructedClass.typeParameters.isNotEmpty()) return super.visitConstructorCall(expression) // Not supported yet require(expression.symbol.owner.isPrimary) { "Non-primary constructors of annotations are not supported" } val implClass = implementations.getOrPut(constructedClass) { createAnnotationImplementation(constructedClass) } @@ -158,6 +157,7 @@ abstract class AnnotationImplementationTransformer(val context: BackendContext, createImplicitParameterDeclarationWithWrappedDescriptor() superTypes = listOf(annotationClass.defaultType) platformSetup() + // Type parameters can be copied from annotationClass, but in fact they are never used by any of the backends. } val ctor = subclass.addConstructor { diff --git a/compiler/testData/codegen/box/annotations/instances/annotationInstances.kt b/compiler/testData/codegen/box/annotations/instances/annotationInstances.kt index fce4dcf6f1a..61339ba15a2 100644 --- a/compiler/testData/codegen/box/annotations/instances/annotationInstances.kt +++ b/compiler/testData/codegen/box/annotations/instances/annotationInstances.kt @@ -1,6 +1,6 @@ // IGNORE_BACKEND: JVM -// (supported: JVM_IR, JS_IR(_E6)) +// (supported: JVM_IR, JS_IR(_ES6), NATIVE) // Regular JS works too, but without proper hashCode or equals // WITH_STDLIB diff --git a/compiler/testData/codegen/box/annotations/instances/annotationWithTypeParameters.kt b/compiler/testData/codegen/box/annotations/instances/annotationWithTypeParameters.kt new file mode 100644 index 00000000000..87d5050fe1d --- /dev/null +++ b/compiler/testData/codegen/box/annotations/instances/annotationWithTypeParameters.kt @@ -0,0 +1,38 @@ +// IGNORE_BACKEND: JVM +// DONT_TARGET_EXACT_BACKEND: JS +// IGNORE_BACKEND: WASM +// WASM ticket: KT-59032 + +// supported: JVM_IR, JS_IR(_ES6), NATIVE + +// WITH_STDLIB +// !LANGUAGE: +InstantiationOfAnnotationClasses + +package test + +import kotlin.reflect.KClass +import kotlin.test.assertEquals +import kotlin.test.assertTrue as assert + +annotation class One() + +annotation class Two(val s: String) +annotation class Nesting(val a1: One = One(), val a2: Two> = Two("two")) + +annotation class WithKClass(val k: KClass) + +fun box(): String { + val a = One() + assert(a.toString().endsWith("test.One()")) + val t = Two("two") + assertEquals("two", t.s) + val n = Nesting() + assertEquals("two", n.a2.s) + val wk = WithKClass(String::class) + assert(String::class == wk.k) + + // type parameters don't affect equals + assert(Two("two") == Two("two")) + assert(WithKClass(Int::class) != WithKClass(String::class)) + return "OK" +} diff --git a/compiler/testData/codegen/box/annotations/instances/annotationWithTypeParametersJvm.kt b/compiler/testData/codegen/box/annotations/instances/annotationWithTypeParametersJvm.kt new file mode 100644 index 00000000000..24821bf9b0a --- /dev/null +++ b/compiler/testData/codegen/box/annotations/instances/annotationWithTypeParametersJvm.kt @@ -0,0 +1,36 @@ +// TARGET_BACKEND: JVM_IR + +// WITH_REFLECT +// !LANGUAGE: +InstantiationOfAnnotationClasses + +import kotlin.reflect.KClass +import kotlin.test.assertEquals +import kotlin.test.assertTrue as assert + +annotation class WithKClass(val k: KClass) + +// Following can't be called on JS/Native, as on these platforms only `Array::class : KClass>` exists. + +annotation class WithArray(val a: KClass>) + +annotation class Combined(val t: KClass, val w: WithKClass, val wa: WithArray) + +class X + +fun box(): String { + val wa = WithArray(Array::class) + assert(wa.a.java.isArray) + assert(wa.a.java.componentType == String::class.java) + assertEquals(WithArray(Array::class), wa) + assert(WithArray(Array::class) != wa) + + val typeParams = WithKClass(X::class).annotationClass.typeParameters + assertEquals(1, typeParams.size) + + val c = Combined(X::class, WithKClass(X::class), WithArray(Array::class)) + assertEquals(X::class, c.t) + assertEquals(X::class, c.w.k) + assertEquals(X::class.java, c.wa.a.java.componentType) + + return "OK" +} diff --git a/compiler/testData/codegen/box/annotations/instances/multimoduleTypeParams.kt b/compiler/testData/codegen/box/annotations/instances/multimoduleTypeParams.kt new file mode 100644 index 00000000000..c5356ddbf2a --- /dev/null +++ b/compiler/testData/codegen/box/annotations/instances/multimoduleTypeParams.kt @@ -0,0 +1,36 @@ +// IGNORE_BACKEND: JVM +// DONT_TARGET_EXACT_BACKEND: JS +// IGNORE_DEXING +// WITH_STDLIB +// !LANGUAGE: +InstantiationOfAnnotationClasses + +// MODULE: lib +// FILE: lib.kt + +package a + +import kotlin.reflect.KClass + +annotation class Two(val s: String) +annotation class Nesting(val a2: Two> = Two("two")) + +annotation class WithKClass(val k: KClass) + + +// MODULE: app(lib) +// FILE: app.kt + +package test + +import a.* +import kotlin.test.* + +fun box(): String { + val t = Two("two") + assertEquals("two", t.s) + val n = Nesting() + assertEquals("two", n.a2.s) + val wk = WithKClass(String::class) + assertTrue(String::class == wk.k) + return "OK" +} diff --git a/compiler/testData/diagnostics/tests/annotations/ConstructorCallAllowed.kt b/compiler/testData/diagnostics/tests/annotations/ConstructorCallAllowed.kt index dd6c521cbab..cb779ca7722 100644 --- a/compiler/testData/diagnostics/tests/annotations/ConstructorCallAllowed.kt +++ b/compiler/testData/diagnostics/tests/annotations/ConstructorCallAllowed.kt @@ -15,5 +15,5 @@ fun box() { val a = A() val b = B(4) val c = C() - val foo = G(Int::class) + val foo = G(Int::class) } 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 f6634f416de..941b48a2600 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 @@ -462,6 +462,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { runTest("compiler/testData/codegen/box/annotations/instances/annotationToString.kt"); } + @Test + @TestMetadata("annotationWithTypeParameters.kt") + public void testAnnotationWithTypeParameters() throws Exception { + runTest("compiler/testData/codegen/box/annotations/instances/annotationWithTypeParameters.kt"); + } + @Test @TestMetadata("annotationsUnsignedTypes.kt") public void testAnnotationsUnsignedTypes() throws Exception { @@ -480,6 +486,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { runTest("compiler/testData/codegen/box/annotations/instances/multifileEqHc.kt"); } + @Test + @TestMetadata("multimoduleTypeParams.kt") + public void testMultimoduleTypeParams() throws Exception { + runTest("compiler/testData/codegen/box/annotations/instances/multimoduleTypeParams.kt"); + } + @Test @TestMetadata("multiplatformInstantiation.kt") public void testMultiplatformInstantiation() 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 15787873ecf..abac0c8c97c 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 @@ -546,6 +546,18 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes runTest("compiler/testData/codegen/box/annotations/instances/annotationType.kt"); } + @Test + @TestMetadata("annotationWithTypeParameters.kt") + public void testAnnotationWithTypeParameters() throws Exception { + runTest("compiler/testData/codegen/box/annotations/instances/annotationWithTypeParameters.kt"); + } + + @Test + @TestMetadata("annotationWithTypeParametersJvm.kt") + public void testAnnotationWithTypeParametersJvm() throws Exception { + runTest("compiler/testData/codegen/box/annotations/instances/annotationWithTypeParametersJvm.kt"); + } + @Test @TestMetadata("annotationsUnsignedTypes.kt") public void testAnnotationsUnsignedTypes() throws Exception { @@ -594,6 +606,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes runTest("compiler/testData/codegen/box/annotations/instances/multimoduleInlining.kt"); } + @Test + @TestMetadata("multimoduleTypeParams.kt") + public void testMultimoduleTypeParams() throws Exception { + runTest("compiler/testData/codegen/box/annotations/instances/multimoduleTypeParams.kt"); + } + @Test @TestMetadata("multiplatformInstantiation.kt") public void testMultiplatformInstantiation() 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 a3e88d8c6ec..31dfc76b4cd 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 @@ -546,6 +546,18 @@ public class IrBlackBoxCodegenWithIrInlinerTestGenerated extends AbstractIrBlack runTest("compiler/testData/codegen/box/annotations/instances/annotationType.kt"); } + @Test + @TestMetadata("annotationWithTypeParameters.kt") + public void testAnnotationWithTypeParameters() throws Exception { + runTest("compiler/testData/codegen/box/annotations/instances/annotationWithTypeParameters.kt"); + } + + @Test + @TestMetadata("annotationWithTypeParametersJvm.kt") + public void testAnnotationWithTypeParametersJvm() throws Exception { + runTest("compiler/testData/codegen/box/annotations/instances/annotationWithTypeParametersJvm.kt"); + } + @Test @TestMetadata("annotationsUnsignedTypes.kt") public void testAnnotationsUnsignedTypes() throws Exception { @@ -594,6 +606,12 @@ public class IrBlackBoxCodegenWithIrInlinerTestGenerated extends AbstractIrBlack runTest("compiler/testData/codegen/box/annotations/instances/multimoduleInlining.kt"); } + @Test + @TestMetadata("multimoduleTypeParams.kt") + public void testMultimoduleTypeParams() throws Exception { + runTest("compiler/testData/codegen/box/annotations/instances/multimoduleTypeParams.kt"); + } + @Test @TestMetadata("multiplatformInstantiation.kt") public void testMultiplatformInstantiation() 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 a8993e246d6..8b8db1cb584 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java @@ -483,6 +483,16 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes runTest("compiler/testData/codegen/box/annotations/instances/annotationType.kt"); } + @TestMetadata("annotationWithTypeParameters.kt") + public void testAnnotationWithTypeParameters() throws Exception { + runTest("compiler/testData/codegen/box/annotations/instances/annotationWithTypeParameters.kt"); + } + + @TestMetadata("annotationWithTypeParametersJvm.kt") + public void testAnnotationWithTypeParametersJvm() throws Exception { + runTest("compiler/testData/codegen/box/annotations/instances/annotationWithTypeParametersJvm.kt"); + } + @TestMetadata("annotationsUnsignedTypes.kt") public void testAnnotationsUnsignedTypes() throws Exception { runTest("compiler/testData/codegen/box/annotations/instances/annotationsUnsignedTypes.kt"); @@ -518,6 +528,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes runTest("compiler/testData/codegen/box/annotations/instances/multimoduleInlining.kt"); } + @TestMetadata("multimoduleTypeParams.kt") + public void testMultimoduleTypeParams() throws Exception { + runTest("compiler/testData/codegen/box/annotations/instances/multimoduleTypeParams.kt"); + } + @TestMetadata("multiplatformInstantiation.kt") public void testMultiplatformInstantiation() throws Exception { runTest("compiler/testData/codegen/box/annotations/instances/multiplatformInstantiation.kt"); 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 888c16b58f2..2f93ca80fcc 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 @@ -126,6 +126,12 @@ public class FirJsCodegenBoxTestGenerated extends AbstractFirJsCodegenBoxTest { runTest("compiler/testData/codegen/box/annotations/instances/annotationToString.kt"); } + @Test + @TestMetadata("annotationWithTypeParameters.kt") + public void testAnnotationWithTypeParameters() throws Exception { + runTest("compiler/testData/codegen/box/annotations/instances/annotationWithTypeParameters.kt"); + } + @Test @TestMetadata("annotationsUnsignedTypes.kt") public void testAnnotationsUnsignedTypes() throws Exception { @@ -144,6 +150,12 @@ public class FirJsCodegenBoxTestGenerated extends AbstractFirJsCodegenBoxTest { runTest("compiler/testData/codegen/box/annotations/instances/multifileEqHc.kt"); } + @Test + @TestMetadata("multimoduleTypeParams.kt") + public void testMultimoduleTypeParams() throws Exception { + runTest("compiler/testData/codegen/box/annotations/instances/multimoduleTypeParams.kt"); + } + @Test @TestMetadata("multiplatformInstantiation.kt") public void testMultiplatformInstantiation() 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 5ff2b8e437f..0df9160a91b 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 @@ -126,6 +126,12 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { runTest("compiler/testData/codegen/box/annotations/instances/annotationToString.kt"); } + @Test + @TestMetadata("annotationWithTypeParameters.kt") + public void testAnnotationWithTypeParameters() throws Exception { + runTest("compiler/testData/codegen/box/annotations/instances/annotationWithTypeParameters.kt"); + } + @Test @TestMetadata("annotationsUnsignedTypes.kt") public void testAnnotationsUnsignedTypes() throws Exception { @@ -144,6 +150,12 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { runTest("compiler/testData/codegen/box/annotations/instances/multifileEqHc.kt"); } + @Test + @TestMetadata("multimoduleTypeParams.kt") + public void testMultimoduleTypeParams() throws Exception { + runTest("compiler/testData/codegen/box/annotations/instances/multimoduleTypeParams.kt"); + } + @Test @TestMetadata("multiplatformInstantiation.kt") public void testMultiplatformInstantiation() 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 35d00bdec41..00ebb2269d9 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 @@ -126,6 +126,12 @@ public class IrJsES6CodegenBoxTestGenerated extends AbstractIrJsES6CodegenBoxTes runTest("compiler/testData/codegen/box/annotations/instances/annotationToString.kt"); } + @Test + @TestMetadata("annotationWithTypeParameters.kt") + public void testAnnotationWithTypeParameters() throws Exception { + runTest("compiler/testData/codegen/box/annotations/instances/annotationWithTypeParameters.kt"); + } + @Test @TestMetadata("annotationsUnsignedTypes.kt") public void testAnnotationsUnsignedTypes() throws Exception { @@ -144,6 +150,12 @@ public class IrJsES6CodegenBoxTestGenerated extends AbstractIrJsES6CodegenBoxTes runTest("compiler/testData/codegen/box/annotations/instances/multifileEqHc.kt"); } + @Test + @TestMetadata("multimoduleTypeParams.kt") + public void testMultimoduleTypeParams() throws Exception { + runTest("compiler/testData/codegen/box/annotations/instances/multimoduleTypeParams.kt"); + } + @Test @TestMetadata("multiplatformInstantiation.kt") public void testMultiplatformInstantiation() 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 c8fb3b22f0c..e363c643af0 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 @@ -143,6 +143,12 @@ public class FirNativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTe runTest("compiler/testData/codegen/box/annotations/instances/annotationToString.kt"); } + @Test + @TestMetadata("annotationWithTypeParameters.kt") + public void testAnnotationWithTypeParameters() throws Exception { + runTest("compiler/testData/codegen/box/annotations/instances/annotationWithTypeParameters.kt"); + } + @Test @TestMetadata("annotationsUnsignedTypes.kt") public void testAnnotationsUnsignedTypes() throws Exception { @@ -161,6 +167,12 @@ public class FirNativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTe runTest("compiler/testData/codegen/box/annotations/instances/multifileEqHc.kt"); } + @Test + @TestMetadata("multimoduleTypeParams.kt") + public void testMultimoduleTypeParams() throws Exception { + runTest("compiler/testData/codegen/box/annotations/instances/multimoduleTypeParams.kt"); + } + @Test @TestMetadata("multiplatformInstantiation.kt") public void testMultiplatformInstantiation() 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 08828f930ef..eceec4b088f 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 @@ -153,6 +153,12 @@ public class FirNativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenB runTest("compiler/testData/codegen/box/annotations/instances/annotationToString.kt"); } + @Test + @TestMetadata("annotationWithTypeParameters.kt") + public void testAnnotationWithTypeParameters() throws Exception { + runTest("compiler/testData/codegen/box/annotations/instances/annotationWithTypeParameters.kt"); + } + @Test @TestMetadata("annotationsUnsignedTypes.kt") public void testAnnotationsUnsignedTypes() throws Exception { @@ -171,6 +177,12 @@ public class FirNativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenB runTest("compiler/testData/codegen/box/annotations/instances/multifileEqHc.kt"); } + @Test + @TestMetadata("multimoduleTypeParams.kt") + public void testMultimoduleTypeParams() throws Exception { + runTest("compiler/testData/codegen/box/annotations/instances/multimoduleTypeParams.kt"); + } + @Test @TestMetadata("multiplatformInstantiation.kt") public void testMultiplatformInstantiation() 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 fb248c740cc..4402f065306 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 @@ -139,6 +139,12 @@ public class NativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTest runTest("compiler/testData/codegen/box/annotations/instances/annotationToString.kt"); } + @Test + @TestMetadata("annotationWithTypeParameters.kt") + public void testAnnotationWithTypeParameters() throws Exception { + runTest("compiler/testData/codegen/box/annotations/instances/annotationWithTypeParameters.kt"); + } + @Test @TestMetadata("annotationsUnsignedTypes.kt") public void testAnnotationsUnsignedTypes() throws Exception { @@ -157,6 +163,12 @@ public class NativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTest runTest("compiler/testData/codegen/box/annotations/instances/multifileEqHc.kt"); } + @Test + @TestMetadata("multimoduleTypeParams.kt") + public void testMultimoduleTypeParams() throws Exception { + runTest("compiler/testData/codegen/box/annotations/instances/multimoduleTypeParams.kt"); + } + @Test @TestMetadata("multiplatformInstantiation.kt") public void testMultiplatformInstantiation() 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 9c1e9d6973a..f67fa294556 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 @@ -144,6 +144,12 @@ public class NativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenBoxT runTest("compiler/testData/codegen/box/annotations/instances/annotationToString.kt"); } + @Test + @TestMetadata("annotationWithTypeParameters.kt") + public void testAnnotationWithTypeParameters() throws Exception { + runTest("compiler/testData/codegen/box/annotations/instances/annotationWithTypeParameters.kt"); + } + @Test @TestMetadata("annotationsUnsignedTypes.kt") public void testAnnotationsUnsignedTypes() throws Exception { @@ -162,6 +168,12 @@ public class NativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenBoxT runTest("compiler/testData/codegen/box/annotations/instances/multifileEqHc.kt"); } + @Test + @TestMetadata("multimoduleTypeParams.kt") + public void testMultimoduleTypeParams() throws Exception { + runTest("compiler/testData/codegen/box/annotations/instances/multimoduleTypeParams.kt"); + } + @Test @TestMetadata("multiplatformInstantiation.kt") public void testMultiplatformInstantiation() 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 864933919b1..32e91e5bced 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 @@ -126,6 +126,12 @@ public class FirWasmCodegenBoxTestGenerated extends AbstractFirWasmCodegenBoxTes runTest("compiler/testData/codegen/box/annotations/instances/annotationToString.kt"); } + @Test + @TestMetadata("annotationWithTypeParameters.kt") + public void testAnnotationWithTypeParameters() throws Exception { + runTest("compiler/testData/codegen/box/annotations/instances/annotationWithTypeParameters.kt"); + } + @Test @TestMetadata("annotationsUnsignedTypes.kt") public void testAnnotationsUnsignedTypes() throws Exception { @@ -144,6 +150,12 @@ public class FirWasmCodegenBoxTestGenerated extends AbstractFirWasmCodegenBoxTes runTest("compiler/testData/codegen/box/annotations/instances/multifileEqHc.kt"); } + @Test + @TestMetadata("multimoduleTypeParams.kt") + public void testMultimoduleTypeParams() throws Exception { + runTest("compiler/testData/codegen/box/annotations/instances/multimoduleTypeParams.kt"); + } + @Test @TestMetadata("multiplatformInstantiation.kt") public void testMultiplatformInstantiation() 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 b00751657f1..0419b5f643d 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 @@ -126,6 +126,12 @@ public class K1WasmCodegenBoxTestGenerated extends AbstractK1WasmCodegenBoxTest runTest("compiler/testData/codegen/box/annotations/instances/annotationToString.kt"); } + @Test + @TestMetadata("annotationWithTypeParameters.kt") + public void testAnnotationWithTypeParameters() throws Exception { + runTest("compiler/testData/codegen/box/annotations/instances/annotationWithTypeParameters.kt"); + } + @Test @TestMetadata("annotationsUnsignedTypes.kt") public void testAnnotationsUnsignedTypes() throws Exception { @@ -144,6 +150,12 @@ public class K1WasmCodegenBoxTestGenerated extends AbstractK1WasmCodegenBoxTest runTest("compiler/testData/codegen/box/annotations/instances/multifileEqHc.kt"); } + @Test + @TestMetadata("multimoduleTypeParams.kt") + public void testMultimoduleTypeParams() throws Exception { + runTest("compiler/testData/codegen/box/annotations/instances/multimoduleTypeParams.kt"); + } + @Test @TestMetadata("multiplatformInstantiation.kt") public void testMultiplatformInstantiation() throws Exception {