From 9f9eef44b14fe3deef1418e841f2a39e6770c817 Mon Sep 17 00:00:00 2001 From: Alexander Udalov Date: Mon, 3 Feb 2020 17:41:26 +0100 Subject: [PATCH] Use captured type approximation from new inference in ExpressionCodegen This is needed in order to avoid star projections being expanded into `out Any?`, which is visible for users of `typeOf` since 1.4. #KT-30278 Fixed --- .../kotlin/codegen/ExpressionCodegen.java | 22 +++++++- .../kotlin/codegen/state/KotlinTypeMapper.kt | 2 +- .../codegen/box/reflection/typeOf/classes.kt | 9 +-- .../box/reflection/typeOf/classesIR.kt | 42 -------------- .../typeOf/js/typeOfCapturedStar.kt | 42 ++++++++++++++ .../reflection/typeOf/noReflect/classes.kt | 8 +-- .../reflection/typeOf/noReflect/classesIR.kt | 43 -------------- .../noReflect/typeReferenceEqualsHashCode.kt | 4 +- .../typeReferenceEqualsHashCodeIR.kt | 56 ------------------- .../reflection/typeOf/typeOfCapturedStar.kt | 40 +++++++++++++ .../codegen/BlackBoxCodegenTestGenerated.java | 5 ++ .../LightAnalysisModeTestGenerated.java | 5 ++ .../ir/FirBlackBoxCodegenTestGenerated.java | 20 ++----- .../ir/IrBlackBoxCodegenTestGenerated.java | 20 ++----- .../IrJsCodegenBoxTestGenerated.java | 15 +++-- .../semantics/JsCodegenBoxTestGenerated.java | 15 +++-- 16 files changed, 153 insertions(+), 195 deletions(-) delete mode 100644 compiler/testData/codegen/box/reflection/typeOf/classesIR.kt create mode 100644 compiler/testData/codegen/box/reflection/typeOf/js/typeOfCapturedStar.kt delete mode 100644 compiler/testData/codegen/box/reflection/typeOf/noReflect/classesIR.kt delete mode 100644 compiler/testData/codegen/box/reflection/typeOf/noReflect/typeReferenceEqualsHashCodeIR.kt create mode 100644 compiler/testData/codegen/box/reflection/typeOf/typeOfCapturedStar.kt diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/ExpressionCodegen.java b/compiler/backend/src/org/jetbrains/kotlin/codegen/ExpressionCodegen.java index 6d7d03a2e8e..4f49bd1d5cf 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/ExpressionCodegen.java +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/ExpressionCodegen.java @@ -60,6 +60,7 @@ import org.jetbrains.kotlin.psi.psiUtil.PsiUtilsKt; import org.jetbrains.kotlin.resolve.*; import org.jetbrains.kotlin.resolve.calls.callResolverUtil.CallResolverUtilKt; import org.jetbrains.kotlin.resolve.calls.callUtil.CallUtilKt; +import org.jetbrains.kotlin.resolve.calls.inference.CapturedTypeConstructorKt; import org.jetbrains.kotlin.resolve.calls.model.*; import org.jetbrains.kotlin.resolve.calls.util.CallMaker; import org.jetbrains.kotlin.resolve.calls.util.FakeCallableDescriptorForObject; @@ -2764,10 +2765,9 @@ public class ExpressionCodegen extends KtVisitor impleme Pair typeParameterAndReificationArgument = extractReificationArgument(typeSystem, type); if (typeParameterAndReificationArgument == null) { - KotlinType approximatedType = CapturedTypeApproximationKt.approximateCapturedTypes(entry.getValue()).getUpper(); - // type is not generic + KotlinType approximatedType = approximateCapturedType(type); JvmSignatureWriter signatureWriter = new BothSignatureWriter(BothSignatureWriter.Mode.TYPE); - Type asmType = typeMapper.mapTypeParameter(approximatedType, signatureWriter); + Type asmType = typeMapper.mapTypeArgument(approximatedType, signatureWriter); mappings.addParameterMappingToType( key.getName().getIdentifier(), approximatedType, asmType, signatureWriter.toString(), isReified @@ -2783,6 +2783,22 @@ public class ExpressionCodegen extends KtVisitor impleme return getOrCreateCallGenerator(descriptor, resolvedCall.getCall().getCallElement(), mappings, false); } + @NotNull + private KotlinType approximateCapturedType(@NotNull KotlinType type) { + if (state.getLanguageVersionSettings().supportsFeature(LanguageFeature.NewInference)) { + TypeApproximator approximator = new TypeApproximator(state.getModule().getBuiltIns()); + + KotlinType approximatedType = + CapturedTypeConstructorKt.isCaptured(type) ? + (KotlinType) approximator.approximateToSuperType( + type, TypeApproximatorConfiguration.CapturedAndIntegerLiteralsTypesApproximation.INSTANCE + ) : null; + return approximatedType != null ? approximatedType : type; + } else { + return CapturedTypeApproximationKt.approximateCapturedTypes(type).getUpper(); + } + } + @NotNull private static Map getTypeArgumentsForResolvedCall( @NotNull ResolvedCall resolvedCall, diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/state/KotlinTypeMapper.kt b/compiler/backend/src/org/jetbrains/kotlin/codegen/state/KotlinTypeMapper.kt index 7acc29f806e..21505664194 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/state/KotlinTypeMapper.kt +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/state/KotlinTypeMapper.kt @@ -215,7 +215,7 @@ class KotlinTypeMapper @JvmOverloads constructor( return mapType(type, signatureVisitor, TypeMappingMode.SUPER_TYPE) } - fun mapTypeParameter(type: KotlinType, signatureVisitor: JvmSignatureWriter?): Type { + fun mapTypeArgument(type: KotlinType, signatureVisitor: JvmSignatureWriter?): Type { return mapType(type, signatureVisitor, TypeMappingMode.GENERIC_ARGUMENT) } diff --git a/compiler/testData/codegen/box/reflection/typeOf/classes.kt b/compiler/testData/codegen/box/reflection/typeOf/classes.kt index 15f66b62f1c..0955e8e1f35 100644 --- a/compiler/testData/codegen/box/reflection/typeOf/classes.kt +++ b/compiler/testData/codegen/box/reflection/typeOf/classes.kt @@ -1,6 +1,7 @@ // !USE_EXPERIMENTAL: kotlin.ExperimentalStdlibApi +// !LANGUAGE: +NewInference // IGNORE_BACKEND_FIR: JVM_IR -// IGNORE_BACKEND: JS, JS_IR, NATIVE, JVM_IR +// TARGET_BACKEND: JVM // WITH_REFLECT package test @@ -25,12 +26,12 @@ fun box(): String { check("test.C?", typeOf()) check("kotlin.collections.List", typeOf>()) - check("kotlin.collections.Map?", typeOf?>()) - check("kotlin.Enum>", typeOf>()) + check("kotlin.collections.Map?", typeOf?>()) + check("kotlin.Enum<*>", typeOf>()) check("kotlin.Enum", typeOf>()) check("kotlin.Array", typeOf>()) - check("kotlin.Array", typeOf>()) + check("kotlin.Array<*>", typeOf>()) check("kotlin.Array", typeOf>()) check("kotlin.Array?>", typeOf?>>()) diff --git a/compiler/testData/codegen/box/reflection/typeOf/classesIR.kt b/compiler/testData/codegen/box/reflection/typeOf/classesIR.kt deleted file mode 100644 index 9623e90cba6..00000000000 --- a/compiler/testData/codegen/box/reflection/typeOf/classesIR.kt +++ /dev/null @@ -1,42 +0,0 @@ -// !USE_EXPERIMENTAL: kotlin.ExperimentalStdlibApi -// IGNORE_BACKEND_FIR: JVM_IR -// TARGET_BACKEND: JVM_IR -// WITH_REFLECT - -package test - -import kotlin.reflect.KType -import kotlin.reflect.typeOf -import kotlin.test.assertEquals - -class C - -fun check(expected: String, actual: KType) { - assertEquals(expected, actual.toString()) -} - -fun box(): String { - check("kotlin.Any", typeOf()) - check("kotlin.String", typeOf()) - check("kotlin.String?", typeOf()) - check("kotlin.Unit", typeOf()) - - check("test.C", typeOf()) - check("test.C?", typeOf()) - - check("kotlin.collections.List", typeOf>()) - check("kotlin.collections.Map?", typeOf?>()) - check("kotlin.Enum<*>", typeOf>()) - check("kotlin.Enum", typeOf>()) - - check("kotlin.Array", typeOf>()) - check("kotlin.Array<*>", typeOf>()) - check("kotlin.Array", typeOf>()) - check("kotlin.Array?>", typeOf?>>()) - - check("kotlin.Int", typeOf()) - check("kotlin.Int?", typeOf()) - check("kotlin.Boolean", typeOf()) - - return "OK" -} diff --git a/compiler/testData/codegen/box/reflection/typeOf/js/typeOfCapturedStar.kt b/compiler/testData/codegen/box/reflection/typeOf/js/typeOfCapturedStar.kt new file mode 100644 index 00000000000..75f033827d0 --- /dev/null +++ b/compiler/testData/codegen/box/reflection/typeOf/js/typeOfCapturedStar.kt @@ -0,0 +1,42 @@ +// !USE_EXPERIMENTAL: kotlin.ExperimentalStdlibApi +// !LANGUAGE: +NewInference +// TARGET_BACKEND: JS +// WITH_REFLECT +// KJS_WITH_FULL_RUNTIME + +import kotlin.reflect.typeOf +import kotlin.reflect.KClass +import kotlin.reflect.KType + +// TODO: deduplicate this test with ../typeOfCapturedStar.kt after fixing KType.toString in JS to return qualified name instead of simple + +interface KFunction + +val KClass.primaryConstructor0: KFunction + get() = object : KFunction {} + +interface A { + val t: T +} + +inline fun , E : Any> bar(w: A): Pair> { + val q: KFunction = w.t::class.primaryConstructor0 + return typeOf() to q +} + +inline fun typeOfValue(q: Q): KType { + return typeOf() +} + +fun box(): String { + val q: A<*> = object : A { + override val t: CharSequence + get() = "" + } + val (w, f) = bar(q) // T should be inferred to KFunction and should be approximated to KFunction, not KFunction<*> + + val expected = "KFunction" + if (w.toString() != expected) return "Fail 1: $w" + if (typeOfValue(f).toString() != expected) return "Fail 2: $f" + return "OK" +} diff --git a/compiler/testData/codegen/box/reflection/typeOf/noReflect/classes.kt b/compiler/testData/codegen/box/reflection/typeOf/noReflect/classes.kt index edbc9643d8f..f2c57cead3d 100644 --- a/compiler/testData/codegen/box/reflection/typeOf/noReflect/classes.kt +++ b/compiler/testData/codegen/box/reflection/typeOf/noReflect/classes.kt @@ -1,7 +1,7 @@ // !USE_EXPERIMENTAL: kotlin.ExperimentalStdlibApi +// !LANGUAGE: +NewInference // IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM -// IGNORE_BACKEND: JVM_IR // WITH_RUNTIME package test @@ -26,12 +26,12 @@ fun box(): String { check("test.C?", typeOf()) check("java.util.List", typeOf>()) - check("java.util.Map?", typeOf?>()) - check("java.lang.Enum>", typeOf>()) + check("java.util.Map?", typeOf?>()) + check("java.lang.Enum<*>", typeOf>()) check("java.lang.Enum", typeOf>()) check("kotlin.Array", typeOf>()) - check("kotlin.Array", typeOf>()) + check("kotlin.Array<*>", typeOf>()) check("kotlin.Array", typeOf>()) check("kotlin.Array?>", typeOf?>>()) diff --git a/compiler/testData/codegen/box/reflection/typeOf/noReflect/classesIR.kt b/compiler/testData/codegen/box/reflection/typeOf/noReflect/classesIR.kt deleted file mode 100644 index 1ee0e1e707c..00000000000 --- a/compiler/testData/codegen/box/reflection/typeOf/noReflect/classesIR.kt +++ /dev/null @@ -1,43 +0,0 @@ -// !USE_EXPERIMENTAL: kotlin.ExperimentalStdlibApi -// IGNORE_BACKEND_FIR: JVM_IR -// TARGET_BACKEND: JVM_IR -// WITH_RUNTIME -// Separate test is needed for IR because type arguments of typeOf are computed differently. - -package test - -import kotlin.reflect.KType -import kotlin.reflect.typeOf -import kotlin.test.assertEquals - -class C - -fun check(expected: String, actual: KType) { - assertEquals(expected + " (Kotlin reflection is not available)", actual.toString()) -} - -fun box(): String { - check("java.lang.Object", typeOf()) - check("java.lang.String", typeOf()) - check("java.lang.String?", typeOf()) - check("kotlin.Unit", typeOf()) - - check("test.C", typeOf()) - check("test.C?", typeOf()) - - check("java.util.List", typeOf>()) - check("java.util.Map?", typeOf?>()) - check("java.lang.Enum<*>", typeOf>()) - check("java.lang.Enum", typeOf>()) - - check("kotlin.Array", typeOf>()) - check("kotlin.Array<*>", typeOf>()) - check("kotlin.Array", typeOf>()) - check("kotlin.Array?>", typeOf?>>()) - - check("int", typeOf()) - check("java.lang.Integer?", typeOf()) - check("boolean", typeOf()) - - return "OK" -} diff --git a/compiler/testData/codegen/box/reflection/typeOf/noReflect/typeReferenceEqualsHashCode.kt b/compiler/testData/codegen/box/reflection/typeOf/noReflect/typeReferenceEqualsHashCode.kt index 2331a9a85b2..9d865b214d5 100644 --- a/compiler/testData/codegen/box/reflection/typeOf/noReflect/typeReferenceEqualsHashCode.kt +++ b/compiler/testData/codegen/box/reflection/typeOf/noReflect/typeReferenceEqualsHashCode.kt @@ -1,7 +1,7 @@ // !USE_EXPERIMENTAL: kotlin.ExperimentalStdlibApi +// !LANGUAGE: +NewInference // IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM -// IGNORE_BACKEND: JVM_IR // WITH_RUNTIME package test @@ -41,7 +41,7 @@ fun box(): String { equal, Array>() equal, Array>() - equal, Array>() // This is subject to change if we retain star projections in typeOf + equal, Array<*>>() equal() equal() diff --git a/compiler/testData/codegen/box/reflection/typeOf/noReflect/typeReferenceEqualsHashCodeIR.kt b/compiler/testData/codegen/box/reflection/typeOf/noReflect/typeReferenceEqualsHashCodeIR.kt deleted file mode 100644 index 3b92f720cac..00000000000 --- a/compiler/testData/codegen/box/reflection/typeOf/noReflect/typeReferenceEqualsHashCodeIR.kt +++ /dev/null @@ -1,56 +0,0 @@ -// !USE_EXPERIMENTAL: kotlin.ExperimentalStdlibApi -// IGNORE_BACKEND_FIR: JVM_IR -// TARGET_BACKEND: JVM_IR -// WITH_RUNTIME -// Separate test is needed for IR because of different ways type arguments of typeOf are calculated. - -package test - -import kotlin.reflect.KType -import kotlin.reflect.typeOf - -class C - -fun assertEqual(a: KType, b: KType) { - if (a != b || b != a) throw AssertionError("Fail equals: $a != $b") - if (a.hashCode() != b.hashCode()) throw AssertionError("Fail hashCode: $a != $b") -} - -fun assertNotEqual(a: KType, b: KType) { - if (a == b || b == a) throw AssertionError("Fail equals: $a == $b") -} - -inline fun equal() { - assertEqual(typeOf(), typeOf()) -} - -inline fun notEqual() { - assertNotEqual(typeOf(), typeOf()) -} - -fun box(): String { - equal() - equal() - equal() - - equal() - equal() - - equal, List>() - equal, Enum>() - - equal, Array>() - equal, Array>() - equal, Array<*>>() - - equal() - equal() - - notEqual() - notEqual() - notEqual, List>() - notEqual, Map>() - notEqual, Array>>() - - return "OK" -} diff --git a/compiler/testData/codegen/box/reflection/typeOf/typeOfCapturedStar.kt b/compiler/testData/codegen/box/reflection/typeOf/typeOfCapturedStar.kt new file mode 100644 index 00000000000..68e51da5002 --- /dev/null +++ b/compiler/testData/codegen/box/reflection/typeOf/typeOfCapturedStar.kt @@ -0,0 +1,40 @@ +// !USE_EXPERIMENTAL: kotlin.ExperimentalStdlibApi +// !LANGUAGE: +NewInference +// IGNORE_BACKEND_FIR: JVM_IR +// IGNORE_BACKEND: JS, JS_IR +// WITH_REFLECT + +import kotlin.reflect.typeOf +import kotlin.reflect.KClass +import kotlin.reflect.KType + +interface KFunction + +val KClass.primaryConstructor0: KFunction + get() = object : KFunction {} + +interface A { + val t: T +} + +inline fun , E : Any> bar(w: A): Pair> { + val q: KFunction = w.t::class.primaryConstructor0 + return typeOf() to q +} + +inline fun typeOfValue(q: Q): KType { + return typeOf() +} + +fun box(): String { + val q: A<*> = object : A { + override val t: CharSequence + get() = "" + } + val (w, f) = bar(q) // T should be inferred to KFunction and should be approximated to KFunction, not KFunction<*> + + val expected = "KFunction" + if (w.toString() != expected) return "Fail 1: $w" + if (typeOfValue(f).toString() != expected) return "Fail 2: $f" + return "OK" +} diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java index 66b9b2b41dc..13b254b0b95 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java @@ -25477,6 +25477,11 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { runTest("compiler/testData/codegen/box/reflection/typeOf/multipleLayers.kt"); } + @TestMetadata("typeOfCapturedStar.kt") + public void testTypeOfCapturedStar() throws Exception { + runTest("compiler/testData/codegen/box/reflection/typeOf/typeOfCapturedStar.kt"); + } + @TestMetadata("compiler/testData/codegen/box/reflection/typeOf/js") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java index 6c6f73ab5c5..881c3943095 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java @@ -24294,6 +24294,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes runTest("compiler/testData/codegen/box/reflection/typeOf/multipleLayers.kt"); } + @TestMetadata("typeOfCapturedStar.kt") + public void testTypeOfCapturedStar() throws Exception { + runTest("compiler/testData/codegen/box/reflection/typeOf/typeOfCapturedStar.kt"); + } + @TestMetadata("compiler/testData/codegen/box/reflection/typeOf/js") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/ir/FirBlackBoxCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/ir/FirBlackBoxCodegenTestGenerated.java index be97208fd5f..7547de16fb4 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/ir/FirBlackBoxCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/ir/FirBlackBoxCodegenTestGenerated.java @@ -23971,11 +23971,6 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT runTest("compiler/testData/codegen/box/reflection/typeOf/classes.kt"); } - @TestMetadata("classesIR.kt") - public void testClassesIR() throws Exception { - runTest("compiler/testData/codegen/box/reflection/typeOf/classesIR.kt"); - } - @TestMetadata("inlineClasses.kt") public void testInlineClasses() throws Exception { runTest("compiler/testData/codegen/box/reflection/typeOf/inlineClasses.kt"); @@ -23991,6 +23986,11 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT runTest("compiler/testData/codegen/box/reflection/typeOf/multipleLayers.kt"); } + @TestMetadata("typeOfCapturedStar.kt") + public void testTypeOfCapturedStar() throws Exception { + runTest("compiler/testData/codegen/box/reflection/typeOf/typeOfCapturedStar.kt"); + } + @TestMetadata("compiler/testData/codegen/box/reflection/typeOf/js") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) @@ -24021,11 +24021,6 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT runTest("compiler/testData/codegen/box/reflection/typeOf/noReflect/classes.kt"); } - @TestMetadata("classesIR.kt") - public void testClassesIR() throws Exception { - runTest("compiler/testData/codegen/box/reflection/typeOf/noReflect/classesIR.kt"); - } - @TestMetadata("inlineClasses.kt") public void testInlineClasses() throws Exception { runTest("compiler/testData/codegen/box/reflection/typeOf/noReflect/inlineClasses.kt"); @@ -24035,11 +24030,6 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT public void testTypeReferenceEqualsHashCode() throws Exception { runTest("compiler/testData/codegen/box/reflection/typeOf/noReflect/typeReferenceEqualsHashCode.kt"); } - - @TestMetadata("typeReferenceEqualsHashCodeIR.kt") - public void testTypeReferenceEqualsHashCodeIR() throws Exception { - runTest("compiler/testData/codegen/box/reflection/typeOf/noReflect/typeReferenceEqualsHashCodeIR.kt"); - } } } diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java index 8a14daf2474..84578788285 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java @@ -23971,11 +23971,6 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes runTest("compiler/testData/codegen/box/reflection/typeOf/classes.kt"); } - @TestMetadata("classesIR.kt") - public void testClassesIR() throws Exception { - runTest("compiler/testData/codegen/box/reflection/typeOf/classesIR.kt"); - } - @TestMetadata("inlineClasses.kt") public void testInlineClasses() throws Exception { runTest("compiler/testData/codegen/box/reflection/typeOf/inlineClasses.kt"); @@ -23991,6 +23986,11 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes runTest("compiler/testData/codegen/box/reflection/typeOf/multipleLayers.kt"); } + @TestMetadata("typeOfCapturedStar.kt") + public void testTypeOfCapturedStar() throws Exception { + runTest("compiler/testData/codegen/box/reflection/typeOf/typeOfCapturedStar.kt"); + } + @TestMetadata("compiler/testData/codegen/box/reflection/typeOf/js") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) @@ -24021,11 +24021,6 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes runTest("compiler/testData/codegen/box/reflection/typeOf/noReflect/classes.kt"); } - @TestMetadata("classesIR.kt") - public void testClassesIR() throws Exception { - runTest("compiler/testData/codegen/box/reflection/typeOf/noReflect/classesIR.kt"); - } - @TestMetadata("inlineClasses.kt") public void testInlineClasses() throws Exception { runTest("compiler/testData/codegen/box/reflection/typeOf/noReflect/inlineClasses.kt"); @@ -24035,11 +24030,6 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes public void testTypeReferenceEqualsHashCode() throws Exception { runTest("compiler/testData/codegen/box/reflection/typeOf/noReflect/typeReferenceEqualsHashCode.kt"); } - - @TestMetadata("typeReferenceEqualsHashCodeIR.kt") - public void testTypeReferenceEqualsHashCodeIR() throws Exception { - runTest("compiler/testData/codegen/box/reflection/typeOf/noReflect/typeReferenceEqualsHashCodeIR.kt"); - } } } diff --git a/js/js.tests/test/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java b/js/js.tests/test/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java index 5586bb86694..8329319cdc6 100644 --- a/js/js.tests/test/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java +++ b/js/js.tests/test/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java @@ -19702,11 +19702,6 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/reflection/typeOf"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR, true); } - @TestMetadata("classes.kt") - public void testClasses() throws Exception { - runTest("compiler/testData/codegen/box/reflection/typeOf/classes.kt"); - } - @TestMetadata("inlineClasses.kt") public void testInlineClasses() throws Exception { runTest("compiler/testData/codegen/box/reflection/typeOf/inlineClasses.kt"); @@ -19722,6 +19717,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { runTest("compiler/testData/codegen/box/reflection/typeOf/multipleLayers.kt"); } + @TestMetadata("typeOfCapturedStar.kt") + public void testTypeOfCapturedStar() throws Exception { + runTest("compiler/testData/codegen/box/reflection/typeOf/typeOfCapturedStar.kt"); + } + @TestMetadata("compiler/testData/codegen/box/reflection/typeOf/js") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) @@ -19764,6 +19764,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { runTest("compiler/testData/codegen/box/reflection/typeOf/js/multipleModules.kt"); } + @TestMetadata("typeOfCapturedStar.kt") + public void testTypeOfCapturedStar() throws Exception { + runTest("compiler/testData/codegen/box/reflection/typeOf/js/typeOfCapturedStar.kt"); + } + @TestMetadata("typeOfReifiedUnit.kt") public void testTypeOfReifiedUnit() throws Exception { runTest("compiler/testData/codegen/box/reflection/typeOf/js/typeOfReifiedUnit.kt"); diff --git a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java index aa544a09bac..ed033856b56 100644 --- a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java +++ b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java @@ -19762,11 +19762,6 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/reflection/typeOf"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS, true); } - @TestMetadata("classes.kt") - public void testClasses() throws Exception { - runTest("compiler/testData/codegen/box/reflection/typeOf/classes.kt"); - } - @TestMetadata("inlineClasses.kt") public void testInlineClasses() throws Exception { runTest("compiler/testData/codegen/box/reflection/typeOf/inlineClasses.kt"); @@ -19782,6 +19777,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { runTest("compiler/testData/codegen/box/reflection/typeOf/multipleLayers.kt"); } + @TestMetadata("typeOfCapturedStar.kt") + public void testTypeOfCapturedStar() throws Exception { + runTest("compiler/testData/codegen/box/reflection/typeOf/typeOfCapturedStar.kt"); + } + @TestMetadata("compiler/testData/codegen/box/reflection/typeOf/js") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) @@ -19824,6 +19824,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { runTest("compiler/testData/codegen/box/reflection/typeOf/js/multipleModules.kt"); } + @TestMetadata("typeOfCapturedStar.kt") + public void testTypeOfCapturedStar() throws Exception { + runTest("compiler/testData/codegen/box/reflection/typeOf/js/typeOfCapturedStar.kt"); + } + @TestMetadata("typeOfReifiedUnit.kt") public void testTypeOfReifiedUnit() throws Exception { runTest("compiler/testData/codegen/box/reflection/typeOf/js/typeOfReifiedUnit.kt");