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 5481abfd6e8..313971e3eaf 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 @@ -28519,6 +28519,18 @@ public class FirLightTreeBlackBoxCodegenTestGenerated extends AbstractFirLightTr public void testAnnotationWithDefaults() throws Exception { runTest("compiler/testData/codegen/box/involvesIrInterpreter/serialization/annotationWithDefaults.kt"); } + + @Test + @TestMetadata("nestedTypeAnnotation.kt") + public void testNestedTypeAnnotation() throws Exception { + runTest("compiler/testData/codegen/box/involvesIrInterpreter/serialization/nestedTypeAnnotation.kt"); + } + + @Test + @TestMetadata("typeAnnotation.kt") + public void testTypeAnnotation() throws Exception { + runTest("compiler/testData/codegen/box/involvesIrInterpreter/serialization/typeAnnotation.kt"); + } } } 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 970d659404d..67bdcc9df28 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 @@ -28519,6 +28519,18 @@ public class FirPsiBlackBoxCodegenTestGenerated extends AbstractFirPsiBlackBoxCo public void testAnnotationWithDefaults() throws Exception { runTest("compiler/testData/codegen/box/involvesIrInterpreter/serialization/annotationWithDefaults.kt"); } + + @Test + @TestMetadata("nestedTypeAnnotation.kt") + public void testNestedTypeAnnotation() throws Exception { + runTest("compiler/testData/codegen/box/involvesIrInterpreter/serialization/nestedTypeAnnotation.kt"); + } + + @Test + @TestMetadata("typeAnnotation.kt") + public void testTypeAnnotation() throws Exception { + runTest("compiler/testData/codegen/box/involvesIrInterpreter/serialization/typeAnnotation.kt"); + } } } diff --git a/compiler/ir/ir.interpreter/src/org/jetbrains/kotlin/ir/interpreter/checker/IrConstAnnotationTransformer.kt b/compiler/ir/ir.interpreter/src/org/jetbrains/kotlin/ir/interpreter/checker/IrConstAnnotationTransformer.kt index 0c203e2db70..2babb5e0e6d 100644 --- a/compiler/ir/ir.interpreter/src/org/jetbrains/kotlin/ir/interpreter/checker/IrConstAnnotationTransformer.kt +++ b/compiler/ir/ir.interpreter/src/org/jetbrains/kotlin/ir/interpreter/checker/IrConstAnnotationTransformer.kt @@ -7,10 +7,7 @@ package org.jetbrains.kotlin.ir.interpreter.checker import org.jetbrains.kotlin.constant.EvaluatedConstTracker import org.jetbrains.kotlin.ir.IrElement -import org.jetbrains.kotlin.ir.IrStatement import org.jetbrains.kotlin.ir.declarations.IrAnnotationContainer -import org.jetbrains.kotlin.ir.declarations.IrDeclarationBase -import org.jetbrains.kotlin.ir.declarations.IrField import org.jetbrains.kotlin.ir.declarations.IrFile import org.jetbrains.kotlin.ir.expressions.* import org.jetbrains.kotlin.ir.expressions.impl.IrVarargImpl @@ -19,7 +16,7 @@ import org.jetbrains.kotlin.ir.interpreter.isPrimitiveArray import org.jetbrains.kotlin.ir.interpreter.toIrConst import org.jetbrains.kotlin.ir.types.* -internal class IrConstAnnotationTransformer( +internal abstract class IrConstAnnotationTransformer( interpreter: IrInterpreter, irFile: IrFile, mode: EvaluationMode, @@ -28,17 +25,7 @@ internal class IrConstAnnotationTransformer( onError: (IrFile, IrElement, IrErrorExpression) -> Unit, suppressExceptions: Boolean, ) : IrConstTransformer(interpreter, irFile, mode, evaluatedConstTracker, onWarning, onError, suppressExceptions) { - override fun visitField(declaration: IrField): IrStatement { - transformAnnotations(declaration) - return super.visitField(declaration) - } - - override fun visitDeclaration(declaration: IrDeclarationBase): IrStatement { - transformAnnotations(declaration) - return super.visitDeclaration(declaration) - } - - private fun transformAnnotations(annotationContainer: IrAnnotationContainer) { + protected fun transformAnnotations(annotationContainer: IrAnnotationContainer) { annotationContainer.annotations.forEach { annotation -> transformAnnotation(annotation) } diff --git a/compiler/ir/ir.interpreter/src/org/jetbrains/kotlin/ir/interpreter/checker/IrConstDeclarationAnnotationTransformer.kt b/compiler/ir/ir.interpreter/src/org/jetbrains/kotlin/ir/interpreter/checker/IrConstDeclarationAnnotationTransformer.kt new file mode 100644 index 00000000000..20c1d11e5c0 --- /dev/null +++ b/compiler/ir/ir.interpreter/src/org/jetbrains/kotlin/ir/interpreter/checker/IrConstDeclarationAnnotationTransformer.kt @@ -0,0 +1,29 @@ +/* + * Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.ir.interpreter.checker + +import org.jetbrains.kotlin.constant.EvaluatedConstTracker +import org.jetbrains.kotlin.ir.IrElement +import org.jetbrains.kotlin.ir.IrStatement +import org.jetbrains.kotlin.ir.declarations.IrDeclarationBase +import org.jetbrains.kotlin.ir.declarations.IrFile +import org.jetbrains.kotlin.ir.expressions.IrErrorExpression +import org.jetbrains.kotlin.ir.interpreter.IrInterpreter + +internal class IrConstDeclarationAnnotationTransformer( + interpreter: IrInterpreter, + irFile: IrFile, + mode: EvaluationMode, + evaluatedConstTracker: EvaluatedConstTracker?, + onWarning: (IrFile, IrElement, IrErrorExpression) -> Unit, + onError: (IrFile, IrElement, IrErrorExpression) -> Unit, + suppressExceptions: Boolean, +) : IrConstAnnotationTransformer(interpreter, irFile, mode, evaluatedConstTracker, onWarning, onError, suppressExceptions) { + override fun visitDeclaration(declaration: IrDeclarationBase, data: Nothing?): IrStatement { + transformAnnotations(declaration) + return super.visitDeclaration(declaration, data) + } +} diff --git a/compiler/ir/ir.interpreter/src/org/jetbrains/kotlin/ir/interpreter/checker/IrConstExpressionTransformer.kt b/compiler/ir/ir.interpreter/src/org/jetbrains/kotlin/ir/interpreter/checker/IrConstExpressionTransformer.kt index 0f5e4763841..d02ff9b8f0a 100644 --- a/compiler/ir/ir.interpreter/src/org/jetbrains/kotlin/ir/interpreter/checker/IrConstExpressionTransformer.kt +++ b/compiler/ir/ir.interpreter/src/org/jetbrains/kotlin/ir/interpreter/checker/IrConstExpressionTransformer.kt @@ -26,27 +26,27 @@ internal class IrConstExpressionTransformer( onError: (IrFile, IrElement, IrErrorExpression) -> Unit, suppressExceptions: Boolean, ) : IrConstTransformer(interpreter, irFile, mode, evaluatedConstTracker, onWarning, onError, suppressExceptions) { - override fun visitCall(expression: IrCall): IrExpression { + override fun visitCall(expression: IrCall, data: Nothing?): IrElement { if (expression.canBeInterpreted()) { return expression.interpret(failAsError = false) } - return super.visitCall(expression) + return super.visitCall(expression, data) } - override fun visitField(declaration: IrField): IrStatement { + override fun visitField(declaration: IrField, data: Nothing?): IrStatement { val initializer = declaration.initializer val expression = initializer?.expression ?: return declaration val isConst = declaration.correspondingPropertySymbol?.owner?.isConst == true - if (!isConst) return super.visitField(declaration) + if (!isConst) return super.visitField(declaration, data) if (expression.canBeInterpreted(declaration, interpreter.environment.configuration.copy(treatFloatInSpecialWay = false))) { initializer.expression = expression.interpret(failAsError = true) } - return super.visitField(declaration) + return super.visitField(declaration, data) } - override fun visitStringConcatenation(expression: IrStringConcatenation): IrExpression { + override fun visitStringConcatenation(expression: IrStringConcatenation, data: Nothing?): IrExpression { fun IrExpression.wrapInStringConcat(): IrExpression = IrStringConcatenationImpl( this.startOffset, this.endOffset, expression.type, listOf(this@wrapInStringConcat) ) diff --git a/compiler/ir/ir.interpreter/src/org/jetbrains/kotlin/ir/interpreter/checker/IrConstTransformer.kt b/compiler/ir/ir.interpreter/src/org/jetbrains/kotlin/ir/interpreter/checker/IrConstTransformer.kt index 7251b23c5b1..abdf38383ce 100644 --- a/compiler/ir/ir.interpreter/src/org/jetbrains/kotlin/ir/interpreter/checker/IrConstTransformer.kt +++ b/compiler/ir/ir.interpreter/src/org/jetbrains/kotlin/ir/interpreter/checker/IrConstTransformer.kt @@ -18,13 +18,13 @@ import org.jetbrains.kotlin.ir.interpreter.IrInterpreter import org.jetbrains.kotlin.ir.interpreter.IrInterpreterConfiguration import org.jetbrains.kotlin.ir.interpreter.toConstantValue import org.jetbrains.kotlin.ir.util.dump -import org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid +import org.jetbrains.kotlin.ir.visitors.IrElementTransformer import org.jetbrains.kotlin.name.Name fun IrFile.transformConst( interpreter: IrInterpreter, mode: EvaluationMode, - evaluatedConstTracker: EvaluatedConstTracker?, + evaluatedConstTracker: EvaluatedConstTracker? = null, onWarning: (IrFile, IrElement, IrErrorExpression) -> Unit = { _, _, _ -> }, onError: (IrFile, IrElement, IrErrorExpression) -> Unit = { _, _, _ -> }, suppressExceptions: Boolean = false, @@ -32,13 +32,19 @@ fun IrFile.transformConst( val irConstExpressionTransformer = IrConstExpressionTransformer( interpreter, this, mode, evaluatedConstTracker, onWarning, onError, suppressExceptions ) - val irConstAnnotationTransformer = IrConstAnnotationTransformer( + val irConstDeclarationAnnotationTransformer = IrConstDeclarationAnnotationTransformer( + interpreter, this, mode, evaluatedConstTracker, onWarning, onError, suppressExceptions + ) + val irConstTypeAnnotationTransformer = IrConstTypeAnnotationTransformer( interpreter, this, mode, evaluatedConstTracker, onWarning, onError, suppressExceptions ) this.transform(irConstExpressionTransformer, null) - this.transform(irConstAnnotationTransformer, null) + this.transform(irConstDeclarationAnnotationTransformer, null) + this.transform(irConstTypeAnnotationTransformer, null) } +// Note: We are using `IrElementTransformer` here instead of `IrElementTransformerVoid` to avoid conflicts with `IrTypeVisitorVoid` +// that is used later in `IrConstTypeAnnotationTransformer`. internal abstract class IrConstTransformer( protected val interpreter: IrInterpreter, private val irFile: IrFile, @@ -47,7 +53,7 @@ internal abstract class IrConstTransformer( private val onWarning: (IrFile, IrElement, IrErrorExpression) -> Unit, private val onError: (IrFile, IrElement, IrErrorExpression) -> Unit, private val suppressExceptions: Boolean, -) : IrElementTransformerVoid() { +) : IrElementTransformer { private fun IrExpression.warningIfError(original: IrExpression): IrExpression { if (this is IrErrorExpression) { onWarning(irFile, original, this) diff --git a/compiler/ir/ir.interpreter/src/org/jetbrains/kotlin/ir/interpreter/checker/IrConstTypeAnnotationTransformer.kt b/compiler/ir/ir.interpreter/src/org/jetbrains/kotlin/ir/interpreter/checker/IrConstTypeAnnotationTransformer.kt new file mode 100644 index 00000000000..77ce7f6e4de --- /dev/null +++ b/compiler/ir/ir.interpreter/src/org/jetbrains/kotlin/ir/interpreter/checker/IrConstTypeAnnotationTransformer.kt @@ -0,0 +1,36 @@ +/* + * Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.ir.interpreter.checker + +import org.jetbrains.kotlin.constant.EvaluatedConstTracker +import org.jetbrains.kotlin.ir.IrElement +import org.jetbrains.kotlin.ir.declarations.* +import org.jetbrains.kotlin.ir.expressions.* +import org.jetbrains.kotlin.ir.interpreter.IrInterpreter +import org.jetbrains.kotlin.ir.types.* +import org.jetbrains.kotlin.ir.visitors.IrTypeTransformerVoid + +internal class IrConstTypeAnnotationTransformer( + interpreter: IrInterpreter, + irFile: IrFile, + mode: EvaluationMode, + evaluatedConstTracker: EvaluatedConstTracker?, + onWarning: (IrFile, IrElement, IrErrorExpression) -> Unit, + onError: (IrFile, IrElement, IrErrorExpression) -> Unit, + suppressExceptions: Boolean, +) : IrConstAnnotationTransformer(interpreter, irFile, mode, evaluatedConstTracker, onWarning, onError, suppressExceptions), + IrTypeTransformerVoid { + + override fun transformType(container: IrElement, type: Type, data: Nothing?): Type { + if (type == null) return type + + transformAnnotations(type) + if (type is IrSimpleType) { + type.arguments.mapNotNull { it.typeOrNull }.forEach { transformType(container, it, data) } + } + return type + } +} diff --git a/compiler/testData/codegen/box/involvesIrInterpreter/serialization/nestedTypeAnnotation.kt b/compiler/testData/codegen/box/involvesIrInterpreter/serialization/nestedTypeAnnotation.kt new file mode 100644 index 00000000000..c0971c5ccb4 --- /dev/null +++ b/compiler/testData/codegen/box/involvesIrInterpreter/serialization/nestedTypeAnnotation.kt @@ -0,0 +1,29 @@ +// TARGET_BACKEND: JVM_IR +// TARGET_BACKEND: JS_IR +// TARGET_BACKEND: NATIVE +// WITH_STDLIB + +// MODULE: lib +// FILE: lib.kt + +@Target(AnnotationTarget.TYPE) +@Retention(AnnotationRetention.BINARY) +annotation class TypeAnnotation(val str: String) + +@Target(AnnotationTarget.TYPE) +@Retention(AnnotationRetention.BINARY) +annotation class Nested(val a: TypeAnnotation) + +@Target(AnnotationTarget.TYPE) +@Retention(AnnotationRetention.BINARY) +annotation class NestedArray(val a: Array) + +val a: @Nested(TypeAnnotation("Int" + "Anno")) Int = 1 +val b: @NestedArray([TypeAnnotation("Element1" + "Anno"), TypeAnnotation("Element2" + "Anno")]) Int = 1 + +// MODULE: main +// FILE: main.kt + +fun box(): String { + return "OK" +} diff --git a/compiler/testData/codegen/box/involvesIrInterpreter/serialization/typeAnnotation.kt b/compiler/testData/codegen/box/involvesIrInterpreter/serialization/typeAnnotation.kt new file mode 100644 index 00000000000..20eeea0eeb9 --- /dev/null +++ b/compiler/testData/codegen/box/involvesIrInterpreter/serialization/typeAnnotation.kt @@ -0,0 +1,79 @@ +// TARGET_BACKEND: JVM_IR +// TARGET_BACKEND: JS_IR +// TARGET_BACKEND: NATIVE +// WITH_STDLIB + +// MODULE: lib +// FILE: lib.kt + +@Target(AnnotationTarget.TYPE) +@Retention(AnnotationRetention.BINARY) +annotation class TypeAnnotation(val str: String) + +open class A +interface B +class C : @TypeAnnotation("AClass" + "Anno") A(), @TypeAnnotation("BInterface" + "Anno") B + +val a: @TypeAnnotation("Int" + "Anno") Int = 1 +var b: @TypeAnnotation("List" + "Anno") List< + @TypeAnnotation("Pair" + "Anno")Pair< + @TypeAnnotation("PairInt1" + "Anno") Int, + @TypeAnnotation("PairInt2" + "Anno") Int + > + >? = null + +fun foo(a: @TypeAnnotation("String" + "Anno") String): @TypeAnnotation("Any" + "Anno") Any { + val b : @TypeAnnotation("Double" + "Anno") Double = 1.0 + return b +} + +fun + "Anno") Any> bar(a: @TypeAnnotation("T" + "Anno") T) {} + +fun example(computeAny: @TypeAnnotation("Fun" + "Anno") () -> Any) { + val memoizedFoo: @TypeAnnotation("LocalDelegate" + "Anno") Any by lazy(computeAny) +} + +typealias Fun = @TypeAnnotation("TypeAlias" + "Anno") (Int, Int) -> Int + +fun memberAccess() { + bar<@TypeAnnotation("Float" + "Anno") Float>(1.0f) +} + +val typeOperator = 1L as @TypeAnnotation("Long" + "Anno") Long + +fun withVararg(vararg args: @TypeAnnotation("Byte" + "Anno") Byte) {} + +fun withAnonymousObject() { + object { + fun bar() { + val a: @TypeAnnotation("InsideObject" + "Anno") A? = null + } + } +} + +class Outer { + inner class Inner { + fun foo(): @TypeAnnotation("InsideInner" + "Anno") Int = 0 + } +} + +fun functionWithLambda(action: (Int, String) -> Any) { + action(0, "") +} + +fun lambda() { + functionWithLambda { integer: @TypeAnnotation("InsideLambdaInt" + "Anno") Int, string -> + val a: @TypeAnnotation("InsideLambda" + "Anno") Int = 0 + a + } +} + +val inProjection: MutableList+ "Anno") String> = mutableListOf() +val outProjection: MutableList+ "Anno") String> = mutableListOf() + +// MODULE: main +// FILE: main.kt + +fun box(): String { + return "OK" +} 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 46882d8b798..616b9d082d5 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 @@ -28519,6 +28519,18 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes public void testAnnotationWithDefaults() throws Exception { runTest("compiler/testData/codegen/box/involvesIrInterpreter/serialization/annotationWithDefaults.kt"); } + + @Test + @TestMetadata("nestedTypeAnnotation.kt") + public void testNestedTypeAnnotation() throws Exception { + runTest("compiler/testData/codegen/box/involvesIrInterpreter/serialization/nestedTypeAnnotation.kt"); + } + + @Test + @TestMetadata("typeAnnotation.kt") + public void testTypeAnnotation() throws Exception { + runTest("compiler/testData/codegen/box/involvesIrInterpreter/serialization/typeAnnotation.kt"); + } } } 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 fa732244e78..89b1bf1ff36 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 @@ -28519,6 +28519,18 @@ public class IrBlackBoxCodegenWithIrInlinerTestGenerated extends AbstractIrBlack public void testAnnotationWithDefaults() throws Exception { runTest("compiler/testData/codegen/box/involvesIrInterpreter/serialization/annotationWithDefaults.kt"); } + + @Test + @TestMetadata("nestedTypeAnnotation.kt") + public void testNestedTypeAnnotation() throws Exception { + runTest("compiler/testData/codegen/box/involvesIrInterpreter/serialization/nestedTypeAnnotation.kt"); + } + + @Test + @TestMetadata("typeAnnotation.kt") + public void testTypeAnnotation() throws Exception { + runTest("compiler/testData/codegen/box/involvesIrInterpreter/serialization/typeAnnotation.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 8beb80ab888..e448cb34f8a 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 @@ -21259,6 +21259,18 @@ public class FirJsCodegenBoxTestGenerated extends AbstractFirJsCodegenBoxTest { public void testAnnotationWithDefaults() throws Exception { runTest("compiler/testData/codegen/box/involvesIrInterpreter/serialization/annotationWithDefaults.kt"); } + + @Test + @TestMetadata("nestedTypeAnnotation.kt") + public void testNestedTypeAnnotation() throws Exception { + runTest("compiler/testData/codegen/box/involvesIrInterpreter/serialization/nestedTypeAnnotation.kt"); + } + + @Test + @TestMetadata("typeAnnotation.kt") + public void testTypeAnnotation() throws Exception { + runTest("compiler/testData/codegen/box/involvesIrInterpreter/serialization/typeAnnotation.kt"); + } } } 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 a3ffe1cc46d..7aeef4d7e10 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 @@ -21259,6 +21259,18 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { public void testAnnotationWithDefaults() throws Exception { runTest("compiler/testData/codegen/box/involvesIrInterpreter/serialization/annotationWithDefaults.kt"); } + + @Test + @TestMetadata("nestedTypeAnnotation.kt") + public void testNestedTypeAnnotation() throws Exception { + runTest("compiler/testData/codegen/box/involvesIrInterpreter/serialization/nestedTypeAnnotation.kt"); + } + + @Test + @TestMetadata("typeAnnotation.kt") + public void testTypeAnnotation() throws Exception { + runTest("compiler/testData/codegen/box/involvesIrInterpreter/serialization/typeAnnotation.kt"); + } } } 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 914b0eed9d7..3ee2a880534 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 @@ -21259,6 +21259,18 @@ public class IrJsES6CodegenBoxTestGenerated extends AbstractIrJsES6CodegenBoxTes public void testAnnotationWithDefaults() throws Exception { runTest("compiler/testData/codegen/box/involvesIrInterpreter/serialization/annotationWithDefaults.kt"); } + + @Test + @TestMetadata("nestedTypeAnnotation.kt") + public void testNestedTypeAnnotation() throws Exception { + runTest("compiler/testData/codegen/box/involvesIrInterpreter/serialization/nestedTypeAnnotation.kt"); + } + + @Test + @TestMetadata("typeAnnotation.kt") + public void testTypeAnnotation() throws Exception { + runTest("compiler/testData/codegen/box/involvesIrInterpreter/serialization/typeAnnotation.kt"); + } } } 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 c442dff501a..b51929abb65 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 @@ -24197,6 +24197,18 @@ public class FirNativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTe public void testAnnotationWithDefaults() throws Exception { runTest("compiler/testData/codegen/box/involvesIrInterpreter/serialization/annotationWithDefaults.kt"); } + + @Test + @TestMetadata("nestedTypeAnnotation.kt") + public void testNestedTypeAnnotation() throws Exception { + runTest("compiler/testData/codegen/box/involvesIrInterpreter/serialization/nestedTypeAnnotation.kt"); + } + + @Test + @TestMetadata("typeAnnotation.kt") + public void testTypeAnnotation() throws Exception { + runTest("compiler/testData/codegen/box/involvesIrInterpreter/serialization/typeAnnotation.kt"); + } } } 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 a4c8a107eb9..9874b9528f4 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 @@ -24667,6 +24667,18 @@ public class FirNativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenB public void testAnnotationWithDefaults() throws Exception { runTest("compiler/testData/codegen/box/involvesIrInterpreter/serialization/annotationWithDefaults.kt"); } + + @Test + @TestMetadata("nestedTypeAnnotation.kt") + public void testNestedTypeAnnotation() throws Exception { + runTest("compiler/testData/codegen/box/involvesIrInterpreter/serialization/nestedTypeAnnotation.kt"); + } + + @Test + @TestMetadata("typeAnnotation.kt") + public void testTypeAnnotation() throws Exception { + runTest("compiler/testData/codegen/box/involvesIrInterpreter/serialization/typeAnnotation.kt"); + } } } 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 a920e7dace8..ec011370e5f 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 @@ -23963,6 +23963,18 @@ public class NativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTest public void testAnnotationWithDefaults() throws Exception { runTest("compiler/testData/codegen/box/involvesIrInterpreter/serialization/annotationWithDefaults.kt"); } + + @Test + @TestMetadata("nestedTypeAnnotation.kt") + public void testNestedTypeAnnotation() throws Exception { + runTest("compiler/testData/codegen/box/involvesIrInterpreter/serialization/nestedTypeAnnotation.kt"); + } + + @Test + @TestMetadata("typeAnnotation.kt") + public void testTypeAnnotation() throws Exception { + runTest("compiler/testData/codegen/box/involvesIrInterpreter/serialization/typeAnnotation.kt"); + } } } 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 b60a5798e6d..9a729dab5e7 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 @@ -24198,6 +24198,18 @@ public class NativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenBoxT public void testAnnotationWithDefaults() throws Exception { runTest("compiler/testData/codegen/box/involvesIrInterpreter/serialization/annotationWithDefaults.kt"); } + + @Test + @TestMetadata("nestedTypeAnnotation.kt") + public void testNestedTypeAnnotation() throws Exception { + runTest("compiler/testData/codegen/box/involvesIrInterpreter/serialization/nestedTypeAnnotation.kt"); + } + + @Test + @TestMetadata("typeAnnotation.kt") + public void testTypeAnnotation() throws Exception { + runTest("compiler/testData/codegen/box/involvesIrInterpreter/serialization/typeAnnotation.kt"); + } } }