diff --git a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/DiagnosticCompilerTestFE10TestdataTestGenerated.java b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/DiagnosticCompilerTestFE10TestdataTestGenerated.java index 2641ad56753..b8cd46448fe 100644 --- a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/DiagnosticCompilerTestFE10TestdataTestGenerated.java +++ b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/DiagnosticCompilerTestFE10TestdataTestGenerated.java @@ -3424,6 +3424,40 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia runTest("compiler/testData/diagnostics/tests/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/sourceSinkFeedContexts/ThroughDelegatedLocalVariableMaterializeCase.kt"); } } + + @Nested + @TestMetadata("compiler/testData/diagnostics/tests/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes") + @TestDataPath("$PROJECT_ROOT") + public class TargetTypes { + @Test + public void testAllFilesPresentInTargetTypes() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.(reversed|fir|ll)\\.kts?$"), true, "multiplatform"); + } + + @Test + @TestMetadata("FunctionWithParameterToUnitImplicitLiteralsCase.kt") + public void testFunctionWithParameterToUnitImplicitLiteralsCase() throws Exception { + runTest("compiler/testData/diagnostics/tests/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/FunctionWithParameterToUnitImplicitLiteralsCase.kt"); + } + + @Test + @TestMetadata("FunctionWithReceiverToUnitImplicitLiteralsCase.kt") + public void testFunctionWithReceiverToUnitImplicitLiteralsCase() throws Exception { + runTest("compiler/testData/diagnostics/tests/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/FunctionWithReceiverToUnitImplicitLiteralsCase.kt"); + } + + @Test + @TestMetadata("NothingMaterializeCase.kt") + public void testNothingMaterializeCase() throws Exception { + runTest("compiler/testData/diagnostics/tests/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NothingMaterializeCase.kt"); + } + + @Test + @TestMetadata("NullableNothingNullLiteralMaterializeCase.kt") + public void testNullableNothingNullLiteralMaterializeCase() throws Exception { + runTest("compiler/testData/diagnostics/tests/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullableNothingNullLiteralMaterializeCase.kt"); + } + } } } } diff --git a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated.java b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated.java index ae8f656b57e..e5bf8d9297e 100644 --- a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated.java +++ b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated.java @@ -3424,6 +3424,40 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated runTest("compiler/testData/diagnostics/tests/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/sourceSinkFeedContexts/ThroughDelegatedLocalVariableMaterializeCase.kt"); } } + + @Nested + @TestMetadata("compiler/testData/diagnostics/tests/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes") + @TestDataPath("$PROJECT_ROOT") + public class TargetTypes { + @Test + public void testAllFilesPresentInTargetTypes() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.(reversed|fir|ll)\\.kts?$"), true, "multiplatform"); + } + + @Test + @TestMetadata("FunctionWithParameterToUnitImplicitLiteralsCase.kt") + public void testFunctionWithParameterToUnitImplicitLiteralsCase() throws Exception { + runTest("compiler/testData/diagnostics/tests/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/FunctionWithParameterToUnitImplicitLiteralsCase.kt"); + } + + @Test + @TestMetadata("FunctionWithReceiverToUnitImplicitLiteralsCase.kt") + public void testFunctionWithReceiverToUnitImplicitLiteralsCase() throws Exception { + runTest("compiler/testData/diagnostics/tests/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/FunctionWithReceiverToUnitImplicitLiteralsCase.kt"); + } + + @Test + @TestMetadata("NothingMaterializeCase.kt") + public void testNothingMaterializeCase() throws Exception { + runTest("compiler/testData/diagnostics/tests/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NothingMaterializeCase.kt"); + } + + @Test + @TestMetadata("NullableNothingNullLiteralMaterializeCase.kt") + public void testNullableNothingNullLiteralMaterializeCase() throws Exception { + runTest("compiler/testData/diagnostics/tests/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullableNothingNullLiteralMaterializeCase.kt"); + } + } } } } diff --git a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirLightTreeOldFrontendDiagnosticsTestGenerated.java b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirLightTreeOldFrontendDiagnosticsTestGenerated.java index 785ef0e59c9..28552d76f95 100644 --- a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirLightTreeOldFrontendDiagnosticsTestGenerated.java +++ b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirLightTreeOldFrontendDiagnosticsTestGenerated.java @@ -3424,6 +3424,40 @@ public class FirLightTreeOldFrontendDiagnosticsTestGenerated extends AbstractFir runTest("compiler/testData/diagnostics/tests/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/sourceSinkFeedContexts/ThroughDelegatedLocalVariableMaterializeCase.kt"); } } + + @Nested + @TestMetadata("compiler/testData/diagnostics/tests/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes") + @TestDataPath("$PROJECT_ROOT") + public class TargetTypes { + @Test + public void testAllFilesPresentInTargetTypes() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.(reversed|fir|ll)\\.kts?$"), true, "multiplatform"); + } + + @Test + @TestMetadata("FunctionWithParameterToUnitImplicitLiteralsCase.kt") + public void testFunctionWithParameterToUnitImplicitLiteralsCase() throws Exception { + runTest("compiler/testData/diagnostics/tests/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/FunctionWithParameterToUnitImplicitLiteralsCase.kt"); + } + + @Test + @TestMetadata("FunctionWithReceiverToUnitImplicitLiteralsCase.kt") + public void testFunctionWithReceiverToUnitImplicitLiteralsCase() throws Exception { + runTest("compiler/testData/diagnostics/tests/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/FunctionWithReceiverToUnitImplicitLiteralsCase.kt"); + } + + @Test + @TestMetadata("NothingMaterializeCase.kt") + public void testNothingMaterializeCase() throws Exception { + runTest("compiler/testData/diagnostics/tests/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NothingMaterializeCase.kt"); + } + + @Test + @TestMetadata("NullableNothingNullLiteralMaterializeCase.kt") + public void testNullableNothingNullLiteralMaterializeCase() throws Exception { + runTest("compiler/testData/diagnostics/tests/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullableNothingNullLiteralMaterializeCase.kt"); + } + } } } } diff --git a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirPsiOldFrontendDiagnosticsTestGenerated.java b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirPsiOldFrontendDiagnosticsTestGenerated.java index 6700cd4b434..6dc692fdea3 100644 --- a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirPsiOldFrontendDiagnosticsTestGenerated.java +++ b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirPsiOldFrontendDiagnosticsTestGenerated.java @@ -3430,6 +3430,40 @@ public class FirPsiOldFrontendDiagnosticsTestGenerated extends AbstractFirPsiDia runTest("compiler/testData/diagnostics/tests/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/sourceSinkFeedContexts/ThroughDelegatedLocalVariableMaterializeCase.kt"); } } + + @Nested + @TestMetadata("compiler/testData/diagnostics/tests/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes") + @TestDataPath("$PROJECT_ROOT") + public class TargetTypes { + @Test + public void testAllFilesPresentInTargetTypes() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes"), Pattern.compile("^(.*)\\.kts?$"), Pattern.compile("^(.+)\\.(reversed|fir|ll)\\.kts?$"), true, "multiplatform"); + } + + @Test + @TestMetadata("FunctionWithParameterToUnitImplicitLiteralsCase.kt") + public void testFunctionWithParameterToUnitImplicitLiteralsCase() throws Exception { + runTest("compiler/testData/diagnostics/tests/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/FunctionWithParameterToUnitImplicitLiteralsCase.kt"); + } + + @Test + @TestMetadata("FunctionWithReceiverToUnitImplicitLiteralsCase.kt") + public void testFunctionWithReceiverToUnitImplicitLiteralsCase() throws Exception { + runTest("compiler/testData/diagnostics/tests/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/FunctionWithReceiverToUnitImplicitLiteralsCase.kt"); + } + + @Test + @TestMetadata("NothingMaterializeCase.kt") + public void testNothingMaterializeCase() throws Exception { + runTest("compiler/testData/diagnostics/tests/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NothingMaterializeCase.kt"); + } + + @Test + @TestMetadata("NullableNothingNullLiteralMaterializeCase.kt") + public void testNullableNothingNullLiteralMaterializeCase() throws Exception { + runTest("compiler/testData/diagnostics/tests/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullableNothingNullLiteralMaterializeCase.kt"); + } + } } } } 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 29538f3ea8b..83735273c9e 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 @@ -2833,6 +2833,232 @@ public class FirLightTreeBlackBoxCodegenTestGenerated extends AbstractFirLightTr runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/sourceSinkFeedContexts/ThroughLocalVariable.kt"); } } + + @Nested + @TestMetadata("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes") + @TestDataPath("$PROJECT_ROOT") + public class TargetTypes { + @Test + public void testAllFilesPresentInTargetTypes() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @Test + @TestMetadata("AnonymousObject.kt") + public void testAnonymousObject() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/AnonymousObject.kt"); + } + + @Test + @TestMetadata("DefinitelyNonNullableTypeParameter.kt") + public void testDefinitelyNonNullableTypeParameter() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/DefinitelyNonNullableTypeParameter.kt"); + } + + @Test + @TestMetadata("EnclosingClass.kt") + public void testEnclosingClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingClass.kt"); + } + + @Test + @TestMetadata("EnclosingEnumerationEntryType.kt") + public void testEnclosingEnumerationEntryType() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingEnumerationEntryType.kt"); + } + + @Test + @TestMetadata("EnclosingEnumerationType.kt") + public void testEnclosingEnumerationType() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingEnumerationType.kt"); + } + + @Test + @TestMetadata("EnclosingExplicitlyGenericInnerClass.kt") + public void testEnclosingExplicitlyGenericInnerClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingExplicitlyGenericInnerClass.kt"); + } + + @Test + @TestMetadata("EnclosingGenericClass.kt") + public void testEnclosingGenericClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingGenericClass.kt"); + } + + @Test + @TestMetadata("EnclosingImplicitlyGenericInnerClass.kt") + public void testEnclosingImplicitlyGenericInnerClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingImplicitlyGenericInnerClass.kt"); + } + + @Test + @TestMetadata("EnclosingInnerClass.kt") + public void testEnclosingInnerClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingInnerClass.kt"); + } + + @Test + @TestMetadata("EnumerationType.kt") + public void testEnumerationType() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnumerationType.kt"); + } + + @Test + @TestMetadata("ExplicitlyGenericInnerClass.kt") + public void testExplicitlyGenericInnerClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/ExplicitlyGenericInnerClass.kt"); + } + + @Test + @TestMetadata("FunctionWithParameterToUnit.kt") + public void testFunctionWithParameterToUnit() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/FunctionWithParameterToUnit.kt"); + } + + @Test + @TestMetadata("FunctionWithReceiverToUnit.kt") + public void testFunctionWithReceiverToUnit() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/FunctionWithReceiverToUnit.kt"); + } + + @Test + @TestMetadata("GenericLocalClass.kt") + public void testGenericLocalClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericLocalClass.kt"); + } + + @Test + @TestMetadata("GenericLocalClassWithLeakingTypeParameter.kt") + public void testGenericLocalClassWithLeakingTypeParameter() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericLocalClassWithLeakingTypeParameter.kt"); + } + + @Test + @TestMetadata("GenericWithContravariantTypeParameter.kt") + public void testGenericWithContravariantTypeParameter() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithContravariantTypeParameter.kt"); + } + + @Test + @TestMetadata("GenericWithCovariantTypeParameter.kt") + public void testGenericWithCovariantTypeParameter() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithCovariantTypeParameter.kt"); + } + + @Test + @TestMetadata("GenericWithInProjectedTypeArgument.kt") + public void testGenericWithInProjectedTypeArgument() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithInProjectedTypeArgument.kt"); + } + + @Test + @TestMetadata("GenericWithInvariantTypeParameter.kt") + public void testGenericWithInvariantTypeParameter() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithInvariantTypeParameter.kt"); + } + + @Test + @TestMetadata("GenericWithOutProjectedTypeArgument.kt") + public void testGenericWithOutProjectedTypeArgument() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithOutProjectedTypeArgument.kt"); + } + + @Test + @TestMetadata("GenericWithStarProjectedTypeArgument.kt") + public void testGenericWithStarProjectedTypeArgument() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithStarProjectedTypeArgument.kt"); + } + + @Test + @TestMetadata("ImplicitlyGenericInnerClass.kt") + public void testImplicitlyGenericInnerClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/ImplicitlyGenericInnerClass.kt"); + } + + @Test + @TestMetadata("InnerClass.kt") + public void testInnerClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/InnerClass.kt"); + } + + @Test + @TestMetadata("Int.kt") + public void testInt() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/Int.kt"); + } + + @Test + @TestMetadata("IntersectionType.kt") + public void testIntersectionType() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/IntersectionType.kt"); + } + + @Test + @TestMetadata("LocalClass.kt") + public void testLocalClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/LocalClass.kt"); + } + + @Test + @TestMetadata("NothingYieldCase.kt") + public void testNothingYieldCase() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NothingYieldCase.kt"); + } + + @Test + @TestMetadata("NullableNothing.kt") + public void testNullableNothing() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullableNothing.kt"); + } + + @Test + @TestMetadata("NullableNothingNullLiteralYieldCase.kt") + public void testNullableNothingNullLiteralYieldCase() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullableNothingNullLiteralYieldCase.kt"); + } + + @Test + @TestMetadata("NullableType.kt") + public void testNullableType() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullableType.kt"); + } + + @Test + @TestMetadata("NullableTypeParameter.kt") + public void testNullableTypeParameter() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullableTypeParameter.kt"); + } + + @Test + @TestMetadata("NullaryFunctionToUnit.kt") + public void testNullaryFunctionToUnit() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullaryFunctionToUnit.kt"); + } + + @Test + @TestMetadata("NullaryFunctionWithReturnValue.kt") + public void testNullaryFunctionWithReturnValue() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullaryFunctionWithReturnValue.kt"); + } + + @Test + @TestMetadata("String.kt") + public void testString() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/String.kt"); + } + + @Test + @TestMetadata("SuspendingFunction.kt") + public void testSuspendingFunction() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/SuspendingFunction.kt"); + } + + @Test + @TestMetadata("TypeParameter.kt") + public void testTypeParameter() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/TypeParameter.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 060d0b2fad1..0ceab170158 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 @@ -2833,6 +2833,232 @@ public class FirPsiBlackBoxCodegenTestGenerated extends AbstractFirPsiBlackBoxCo runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/sourceSinkFeedContexts/ThroughLocalVariable.kt"); } } + + @Nested + @TestMetadata("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes") + @TestDataPath("$PROJECT_ROOT") + public class TargetTypes { + @Test + public void testAllFilesPresentInTargetTypes() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @Test + @TestMetadata("AnonymousObject.kt") + public void testAnonymousObject() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/AnonymousObject.kt"); + } + + @Test + @TestMetadata("DefinitelyNonNullableTypeParameter.kt") + public void testDefinitelyNonNullableTypeParameter() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/DefinitelyNonNullableTypeParameter.kt"); + } + + @Test + @TestMetadata("EnclosingClass.kt") + public void testEnclosingClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingClass.kt"); + } + + @Test + @TestMetadata("EnclosingEnumerationEntryType.kt") + public void testEnclosingEnumerationEntryType() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingEnumerationEntryType.kt"); + } + + @Test + @TestMetadata("EnclosingEnumerationType.kt") + public void testEnclosingEnumerationType() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingEnumerationType.kt"); + } + + @Test + @TestMetadata("EnclosingExplicitlyGenericInnerClass.kt") + public void testEnclosingExplicitlyGenericInnerClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingExplicitlyGenericInnerClass.kt"); + } + + @Test + @TestMetadata("EnclosingGenericClass.kt") + public void testEnclosingGenericClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingGenericClass.kt"); + } + + @Test + @TestMetadata("EnclosingImplicitlyGenericInnerClass.kt") + public void testEnclosingImplicitlyGenericInnerClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingImplicitlyGenericInnerClass.kt"); + } + + @Test + @TestMetadata("EnclosingInnerClass.kt") + public void testEnclosingInnerClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingInnerClass.kt"); + } + + @Test + @TestMetadata("EnumerationType.kt") + public void testEnumerationType() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnumerationType.kt"); + } + + @Test + @TestMetadata("ExplicitlyGenericInnerClass.kt") + public void testExplicitlyGenericInnerClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/ExplicitlyGenericInnerClass.kt"); + } + + @Test + @TestMetadata("FunctionWithParameterToUnit.kt") + public void testFunctionWithParameterToUnit() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/FunctionWithParameterToUnit.kt"); + } + + @Test + @TestMetadata("FunctionWithReceiverToUnit.kt") + public void testFunctionWithReceiverToUnit() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/FunctionWithReceiverToUnit.kt"); + } + + @Test + @TestMetadata("GenericLocalClass.kt") + public void testGenericLocalClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericLocalClass.kt"); + } + + @Test + @TestMetadata("GenericLocalClassWithLeakingTypeParameter.kt") + public void testGenericLocalClassWithLeakingTypeParameter() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericLocalClassWithLeakingTypeParameter.kt"); + } + + @Test + @TestMetadata("GenericWithContravariantTypeParameter.kt") + public void testGenericWithContravariantTypeParameter() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithContravariantTypeParameter.kt"); + } + + @Test + @TestMetadata("GenericWithCovariantTypeParameter.kt") + public void testGenericWithCovariantTypeParameter() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithCovariantTypeParameter.kt"); + } + + @Test + @TestMetadata("GenericWithInProjectedTypeArgument.kt") + public void testGenericWithInProjectedTypeArgument() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithInProjectedTypeArgument.kt"); + } + + @Test + @TestMetadata("GenericWithInvariantTypeParameter.kt") + public void testGenericWithInvariantTypeParameter() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithInvariantTypeParameter.kt"); + } + + @Test + @TestMetadata("GenericWithOutProjectedTypeArgument.kt") + public void testGenericWithOutProjectedTypeArgument() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithOutProjectedTypeArgument.kt"); + } + + @Test + @TestMetadata("GenericWithStarProjectedTypeArgument.kt") + public void testGenericWithStarProjectedTypeArgument() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithStarProjectedTypeArgument.kt"); + } + + @Test + @TestMetadata("ImplicitlyGenericInnerClass.kt") + public void testImplicitlyGenericInnerClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/ImplicitlyGenericInnerClass.kt"); + } + + @Test + @TestMetadata("InnerClass.kt") + public void testInnerClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/InnerClass.kt"); + } + + @Test + @TestMetadata("Int.kt") + public void testInt() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/Int.kt"); + } + + @Test + @TestMetadata("IntersectionType.kt") + public void testIntersectionType() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/IntersectionType.kt"); + } + + @Test + @TestMetadata("LocalClass.kt") + public void testLocalClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/LocalClass.kt"); + } + + @Test + @TestMetadata("NothingYieldCase.kt") + public void testNothingYieldCase() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NothingYieldCase.kt"); + } + + @Test + @TestMetadata("NullableNothing.kt") + public void testNullableNothing() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullableNothing.kt"); + } + + @Test + @TestMetadata("NullableNothingNullLiteralYieldCase.kt") + public void testNullableNothingNullLiteralYieldCase() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullableNothingNullLiteralYieldCase.kt"); + } + + @Test + @TestMetadata("NullableType.kt") + public void testNullableType() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullableType.kt"); + } + + @Test + @TestMetadata("NullableTypeParameter.kt") + public void testNullableTypeParameter() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullableTypeParameter.kt"); + } + + @Test + @TestMetadata("NullaryFunctionToUnit.kt") + public void testNullaryFunctionToUnit() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullaryFunctionToUnit.kt"); + } + + @Test + @TestMetadata("NullaryFunctionWithReturnValue.kt") + public void testNullaryFunctionWithReturnValue() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullaryFunctionWithReturnValue.kt"); + } + + @Test + @TestMetadata("String.kt") + public void testString() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/String.kt"); + } + + @Test + @TestMetadata("SuspendingFunction.kt") + public void testSuspendingFunction() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/SuspendingFunction.kt"); + } + + @Test + @TestMetadata("TypeParameter.kt") + public void testTypeParameter() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/TypeParameter.kt"); + } + } } } } diff --git a/compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/AnonymousObject.kt b/compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/AnonymousObject.kt new file mode 100644 index 00000000000..12585517e18 --- /dev/null +++ b/compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/AnonymousObject.kt @@ -0,0 +1,115 @@ +// IGNORE_BACKEND: NATIVE +// IGNORE_BACKEND: WASM +// IGNORE_BACKEND: JS, JS_IR, JS_IR_ES6 +// IGNORE_LIGHT_ANALYSIS + +// CHECK_TYPE_WITH_EXACT + +class Buildee { + fun yield(arg: CT) {} + fun materialize(): CT = reference as CT +} + +fun build( + instructions: Buildee.() -> Unit +): Buildee { + return Buildee().apply(instructions) +} + +private var reference: Any? = null +val Buildee.typeArgumentValue: T get() = reference as T + +// test 1: PTV is in consuming position (yield-case) +fun testYield() { + fun testAnonymousObjectOutsideBuilderArgument() { + val obj = object {} + reference = obj + + val buildee = build { + yield(obj) + } + checkTypeEquality(obj, buildee.typeArgumentValue) + } + + fun testAnonymousObjectInsideBuilderArgument() { + val buildee = build { + val obj = object { fun anonOnlyFunc() {} } + reference = obj + + yield(obj) + } + buildee.typeArgumentValue.anonOnlyFunc() + } + + fun testThisExpression() { + val buildee = build { + val obj = object { + fun anonOnlyFunc() {} + + fun initialize() { + reference = this + + yield(this) + } + } + obj.initialize() + } + buildee.typeArgumentValue.anonOnlyFunc() + } + + testAnonymousObjectOutsideBuilderArgument() + testAnonymousObjectInsideBuilderArgument() + testThisExpression() +} + +// test 2: PTV is in producing position (materialize-case) +fun testMaterialize() { + fun testAnonymousObjectOutsideBuilderArgument() { + val obj = object {} + reference = obj + + val buildee = build { + fun shareTypeInfo(from: T, to: T) {} + shareTypeInfo(obj, materialize()) + } + checkTypeEquality(obj, buildee.typeArgumentValue) + } + + fun testAnonymousObjectInsideBuilderArgument() { + val buildee = build { + val obj = object { fun anonOnlyFunc() {} } + reference = obj + + fun shareTypeInfo(from: T, to: T) {} + shareTypeInfo(obj, materialize()) + } + buildee.typeArgumentValue.anonOnlyFunc() + } + + fun testThisExpression() { + val buildee = build { + val obj = object { + fun anonOnlyFunc() {} + + fun initialize() { + reference = this + + fun shareTypeInfo(from: T, to: T) {} + shareTypeInfo(this, materialize()) + } + } + obj.initialize() + } + buildee.typeArgumentValue.anonOnlyFunc() + } + + testAnonymousObjectOutsideBuilderArgument() + testAnonymousObjectInsideBuilderArgument() + testThisExpression() +} + +fun box(): String { + testYield() + testMaterialize() + return "OK" +} diff --git a/compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/DefinitelyNonNullableTypeParameter.kt b/compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/DefinitelyNonNullableTypeParameter.kt new file mode 100644 index 00000000000..dbef5961c84 --- /dev/null +++ b/compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/DefinitelyNonNullableTypeParameter.kt @@ -0,0 +1,47 @@ +// IGNORE_BACKEND: NATIVE +// IGNORE_BACKEND: WASM +// IGNORE_BACKEND: JS, JS_IR, JS_IR_ES6 +// IGNORE_LIGHT_ANALYSIS + +// CHECK_TYPE_WITH_EXACT + +class Buildee { + fun yield(arg: CT) {} + fun materialize(): CT = UserKlass() as CT +} + +fun build( + instructions: Buildee.() -> Unit +): Buildee { + return Buildee().apply(instructions) +} + +class UserKlass + +class Context { + // test 1: PTV is in consuming position (yield-case) + fun testYield() { + val arg: T & Any = UserKlass() as (T & Any) + val buildee = build { + yield(arg) + } + checkExactType>(buildee) + } + + // test 2: PTV is in producing position (materialize-case) + fun testMaterialize() { + fun consume(arg: T & Any) {} + val buildee = build { + consume(materialize()) + } + checkExactType>(buildee) + } +} + +fun box(): String { + with(Context()) { + testYield() + testMaterialize() + } + return "OK" +} diff --git a/compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingClass.kt b/compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingClass.kt new file mode 100644 index 00000000000..c04bc065c0c --- /dev/null +++ b/compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingClass.kt @@ -0,0 +1,70 @@ +// IGNORE_BACKEND: NATIVE +// IGNORE_BACKEND: WASM +// IGNORE_BACKEND: JS, JS_IR, JS_IR_ES6 +// IGNORE_LIGHT_ANALYSIS + +// CHECK_TYPE_WITH_EXACT + +class Buildee { + fun yield(arg: CT) {} + fun materialize(): CT = UserKlass() as CT +} + +fun build( + instructions: Buildee.() -> Unit +): Buildee { + return Buildee().apply(instructions) +} + +class UserKlass { + // test 1: PTV is in consuming position (yield-case) + fun testYield() { + fun testBasicCase() { + val arg: UserKlass = UserKlass() + val buildee = build { + yield(arg) + } + checkExactType>(buildee) + } + + fun testThisExpression() { + val buildee = build { + yield(this@UserKlass) + } + checkExactType>(buildee) + } + + testBasicCase() + testThisExpression() + } + + // test 2: PTV is in producing position (materialize-case) + fun testMaterialize() { + fun testBasicCase() { + fun consume(arg: UserKlass) {} + val buildee = build { + consume(materialize()) + } + checkExactType>(buildee) + } + + fun testThisExpression() { + fun shareTypeInfo(from: T, to: T) {} + val buildee = build { + shareTypeInfo(this@UserKlass, materialize()) + } + checkExactType>(buildee) + } + + testBasicCase() + testThisExpression() + } +} + +fun box(): String { + with(UserKlass()) { + testYield() + testMaterialize() + } + return "OK" +} diff --git a/compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingEnumerationEntryType.kt b/compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingEnumerationEntryType.kt new file mode 100644 index 00000000000..c8faedbfdc5 --- /dev/null +++ b/compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingEnumerationEntryType.kt @@ -0,0 +1,52 @@ +// IGNORE_BACKEND: NATIVE +// IGNORE_BACKEND: WASM +// IGNORE_BACKEND: JS, JS_IR, JS_IR_ES6 +// IGNORE_LIGHT_ANALYSIS + +// CHECK_TYPE_WITH_EXACT + +class Buildee { + fun yield(arg: CT) {} + fun materialize(): CT = reference as CT +} + +fun build( + instructions: Buildee.() -> Unit +): Buildee { + return Buildee().apply(instructions) +} + +private var reference: Any? = null +val Buildee.typeArgumentValue: T get() = reference as T + +enum class UserEnumeration { + ENUM_ENTRY { + // test 1: PTV is in consuming position (yield-case) + fun testYield() { + val buildee = build { + yield(this@ENUM_ENTRY) + } + checkTypeEquality(this@ENUM_ENTRY, buildee.typeArgumentValue) + } + + // test 2: PTV is in producing position (materialize-case) + fun testMaterialize() { + val buildee = build { + fun shareTypeInfo(from: T, to: T) {} + shareTypeInfo(this@ENUM_ENTRY, materialize()) + } + checkTypeEquality(this@ENUM_ENTRY, buildee.typeArgumentValue) + } + + init { + reference = this@ENUM_ENTRY + testYield() + testMaterialize() + } + }; +} + +fun box(): String { + UserEnumeration.ENUM_ENTRY + return "OK" +} diff --git a/compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingEnumerationType.kt b/compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingEnumerationType.kt new file mode 100644 index 00000000000..e7e5b1ee1d9 --- /dev/null +++ b/compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingEnumerationType.kt @@ -0,0 +1,72 @@ +// IGNORE_BACKEND: NATIVE +// IGNORE_BACKEND: WASM +// IGNORE_BACKEND: JS, JS_IR, JS_IR_ES6 +// IGNORE_LIGHT_ANALYSIS + +// CHECK_TYPE_WITH_EXACT + +class Buildee { + fun yield(arg: CT) {} + fun materialize(): CT = UserEnumeration.ENUM_ENTRY as CT +} + +fun build( + instructions: Buildee.() -> Unit +): Buildee { + return Buildee().apply(instructions) +} + +enum class UserEnumeration { + ENUM_ENTRY; + + // test 1: PTV is in consuming position (yield-case) + fun testYield() { + fun testBasicCase() { + val arg: UserEnumeration = ENUM_ENTRY + val buildee = build { + yield(arg) + } + checkExactType>(buildee) + } + + fun testThisExpression() { + val buildee = build { + yield(this@UserEnumeration) + } + checkExactType>(buildee) + } + + testBasicCase() + testThisExpression() + } + + // test 2: PTV is in producing position (materialize-case) + fun testMaterialize() { + fun testBasicCase() { + fun consume(arg: UserEnumeration) {} + val buildee = build { + consume(materialize()) + } + checkExactType>(buildee) + } + + fun testThisExpression() { + fun shareTypeInfo(from: T, to: T) {} + val buildee = build { + shareTypeInfo(this@UserEnumeration, materialize()) + } + checkExactType>(buildee) + } + + testBasicCase() + testThisExpression() + } +} + +fun box(): String { + with(UserEnumeration.ENUM_ENTRY) { + testYield() + testMaterialize() + } + return "OK" +} diff --git a/compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingExplicitlyGenericInnerClass.kt b/compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingExplicitlyGenericInnerClass.kt new file mode 100644 index 00000000000..bcd631e41c5 --- /dev/null +++ b/compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingExplicitlyGenericInnerClass.kt @@ -0,0 +1,74 @@ +// IGNORE_BACKEND: NATIVE +// IGNORE_BACKEND: WASM +// IGNORE_BACKEND: JS, JS_IR, JS_IR_ES6 +// IGNORE_LIGHT_ANALYSIS + +// CHECK_TYPE_WITH_EXACT + +class Buildee { + fun yield(arg: CT) {} + fun materialize(): CT = UserKlass().Inner() as CT +} + +fun build( + instructions: Buildee.() -> Unit +): Buildee { + return Buildee().apply(instructions) +} + +class UserKlass { + inner class Inner { + // test 1: PTV is in consuming position (yield-case) + fun testYield() { + fun testBasicCase() { + val arg: UserKlass.Inner = UserKlass().Inner() + val buildee = build { + yield(arg) + } + checkExactType>>(buildee) + } + + fun testThisExpression() { + val buildee = build { + yield(this@Inner) + } + checkExactType>>(buildee) + } + + testBasicCase() + testThisExpression() + } + + // test 2: PTV is in producing position (materialize-case) + fun testMaterialize() { + fun testBasicCase() { + fun consume(arg: UserKlass.Inner) {} + val buildee = build { + consume(materialize()) + } + checkExactType>>(buildee) + } + + fun testThisExpression() { + fun shareTypeInfo(from: T, to: T) {} + val buildee = build { + shareTypeInfo(this@Inner, materialize()) + } + checkExactType>>(buildee) + } + + testBasicCase() + testThisExpression() + } + } +} + +class Placeholder + +fun box(): String { + with(UserKlass().Inner()) { + testYield() + testMaterialize() + } + return "OK" +} diff --git a/compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingGenericClass.kt b/compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingGenericClass.kt new file mode 100644 index 00000000000..1b809307e10 --- /dev/null +++ b/compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingGenericClass.kt @@ -0,0 +1,72 @@ +// IGNORE_BACKEND: NATIVE +// IGNORE_BACKEND: WASM +// IGNORE_BACKEND: JS, JS_IR, JS_IR_ES6 +// IGNORE_LIGHT_ANALYSIS + +// CHECK_TYPE_WITH_EXACT + +class Buildee { + fun yield(arg: CT) {} + fun materialize(): CT = UserKlass() as CT +} + +fun build( + instructions: Buildee.() -> Unit +): Buildee { + return Buildee().apply(instructions) +} + +class UserKlass { + // test 1: PTV is in consuming position (yield-case) + fun testYield() { + fun testBasicCase() { + val arg: UserKlass = UserKlass() + val buildee = build { + yield(arg) + } + checkExactType>>(buildee) + } + + fun testThisExpression() { + val buildee = build { + yield(this@UserKlass) + } + checkExactType>>(buildee) + } + + testBasicCase() + testThisExpression() + } + + // test 2: PTV is in producing position (materialize-case) + fun testMaterialize() { + fun testBasicCase() { + fun consume(arg: UserKlass) {} + val buildee = build { + consume(materialize()) + } + checkExactType>>(buildee) + } + + fun testThisExpression() { + fun shareTypeInfo(from: T, to: T) {} + val buildee = build { + shareTypeInfo(this@UserKlass, materialize()) + } + checkExactType>>(buildee) + } + + testBasicCase() + testThisExpression() + } +} + +class Placeholder + +fun box(): String { + with(UserKlass()) { + testYield() + testMaterialize() + } + return "OK" +} diff --git a/compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingImplicitlyGenericInnerClass.kt b/compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingImplicitlyGenericInnerClass.kt new file mode 100644 index 00000000000..2f4638f8399 --- /dev/null +++ b/compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingImplicitlyGenericInnerClass.kt @@ -0,0 +1,74 @@ +// IGNORE_BACKEND: NATIVE +// IGNORE_BACKEND: WASM +// IGNORE_BACKEND: JS, JS_IR, JS_IR_ES6 +// IGNORE_LIGHT_ANALYSIS + +// CHECK_TYPE_WITH_EXACT + +class Buildee { + fun yield(arg: CT) {} + fun materialize(): CT = UserKlass().Inner() as CT +} + +fun build( + instructions: Buildee.() -> Unit +): Buildee { + return Buildee().apply(instructions) +} + +class UserKlass { + inner class Inner { + // test 1: PTV is in consuming position (yield-case) + fun testYield() { + fun testBasicCase() { + val arg: UserKlass.Inner = UserKlass().Inner() + val buildee = build { + yield(arg) + } + checkExactType.Inner>>(buildee) + } + + fun testThisExpression() { + val buildee = build { + yield(this@Inner) + } + checkExactType.Inner>>(buildee) + } + + testBasicCase() + testThisExpression() + } + + // test 2: PTV is in producing position (materialize-case) + fun testMaterialize() { + fun testBasicCase() { + fun consume(arg: UserKlass.Inner) {} + val buildee = build { + consume(materialize()) + } + checkExactType.Inner>>(buildee) + } + + fun testThisExpression() { + fun shareTypeInfo(from: T, to: T) {} + val buildee = build { + shareTypeInfo(this@Inner, materialize()) + } + checkExactType.Inner>>(buildee) + } + + testBasicCase() + testThisExpression() + } + } +} + +class Placeholder + +fun box(): String { + with(UserKlass().Inner()) { + testYield() + testMaterialize() + } + return "OK" +} diff --git a/compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingInnerClass.kt b/compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingInnerClass.kt new file mode 100644 index 00000000000..d789efe11c9 --- /dev/null +++ b/compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingInnerClass.kt @@ -0,0 +1,72 @@ +// IGNORE_BACKEND: NATIVE +// IGNORE_BACKEND: WASM +// IGNORE_BACKEND: JS, JS_IR, JS_IR_ES6 +// IGNORE_LIGHT_ANALYSIS + +// CHECK_TYPE_WITH_EXACT + +class Buildee { + fun yield(arg: CT) {} + fun materialize(): CT = UserKlass().Inner() as CT +} + +fun build( + instructions: Buildee.() -> Unit +): Buildee { + return Buildee().apply(instructions) +} + +class UserKlass { + inner class Inner { + // test 1: PTV is in consuming position (yield-case) + fun testYield() { + fun testBasicCase() { + val arg: UserKlass.Inner = UserKlass().Inner() + val buildee = build { + yield(arg) + } + checkExactType>(buildee) + } + + fun testThisExpression() { + val buildee = build { + yield(this@Inner) + } + checkExactType>(buildee) + } + + testBasicCase() + testThisExpression() + } + + // test 2: PTV is in producing position (materialize-case) + fun testMaterialize() { + fun testBasicCase() { + fun consume(arg: UserKlass.Inner) {} + val buildee = build { + consume(materialize()) + } + checkExactType>(buildee) + } + + fun testThisExpression() { + fun shareTypeInfo(from: T, to: T) {} + val buildee = build { + shareTypeInfo(this@Inner, materialize()) + } + checkExactType>(buildee) + } + + testBasicCase() + testThisExpression() + } + } +} + +fun box(): String { + with(UserKlass().Inner()) { + testYield() + testMaterialize() + } + return "OK" +} diff --git a/compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnumerationType.kt b/compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnumerationType.kt new file mode 100644 index 00000000000..b45e174eb50 --- /dev/null +++ b/compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnumerationType.kt @@ -0,0 +1,70 @@ +// IGNORE_BACKEND: NATIVE +// IGNORE_BACKEND: WASM +// IGNORE_BACKEND: JS, JS_IR, JS_IR_ES6 +// IGNORE_LIGHT_ANALYSIS + +// CHECK_TYPE_WITH_EXACT + +class Buildee { + fun yield(arg: CT) {} + fun materialize(): CT = UserEnumeration.ENUM_ENTRY as CT +} + +fun build( + instructions: Buildee.() -> Unit +): Buildee { + return Buildee().apply(instructions) +} + +enum class UserEnumeration { + ENUM_ENTRY +} + +// test 1: PTV is in consuming position (yield-case) +fun testYield() { + fun testBasicCase() { + val arg: UserEnumeration = UserEnumeration.ENUM_ENTRY + val buildee = build { + yield(arg) + } + checkExactType>(buildee) + } + + fun testEnumEntry() { + val buildee = build { + yield(UserEnumeration.ENUM_ENTRY) + } + checkExactType>(buildee) + } + + testBasicCase() + testEnumEntry() +} + +// test 2: PTV is in producing position (materialize-case) +fun testMaterialize() { + fun testBasicCase() { + fun consume(arg: UserEnumeration) {} + val buildee = build { + consume(materialize()) + } + checkExactType>(buildee) + } + + fun testEnumEntry() { + fun shareTypeInfo(from: T, to: T) {} + val buildee = build { + shareTypeInfo(UserEnumeration.ENUM_ENTRY, materialize()) + } + checkExactType>(buildee) + } + + testBasicCase() + testEnumEntry() +} + +fun box(): String { + testYield() + testMaterialize() + return "OK" +} diff --git a/compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/ExplicitlyGenericInnerClass.kt b/compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/ExplicitlyGenericInnerClass.kt new file mode 100644 index 00000000000..31e162d1f6b --- /dev/null +++ b/compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/ExplicitlyGenericInnerClass.kt @@ -0,0 +1,46 @@ +// IGNORE_BACKEND: NATIVE +// IGNORE_BACKEND: WASM +// IGNORE_BACKEND: JS, JS_IR, JS_IR_ES6 +// IGNORE_LIGHT_ANALYSIS + +// CHECK_TYPE_WITH_EXACT + +class Buildee { + fun yield(arg: CT) {} + fun materialize(): CT = UserKlass().Inner() as CT +} + +fun build( + instructions: Buildee.() -> Unit +): Buildee { + return Buildee().apply(instructions) +} + +class UserKlass { + inner class Inner +} +class Placeholder + +// test 1: PTV is in consuming position (yield-case) +fun testYield() { + val arg: UserKlass.Inner = UserKlass().Inner() + val buildee = build { + yield(arg) + } + checkExactType>>(buildee) +} + +// test 2: PTV is in producing position (materialize-case) +fun testMaterialize() { + fun consume(arg: UserKlass.Inner) {} + val buildee = build { + consume(materialize()) + } + checkExactType>>(buildee) +} + +fun box(): String { + testYield() + testMaterialize() + return "OK" +} diff --git a/compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/FunctionWithParameterToUnit.kt b/compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/FunctionWithParameterToUnit.kt new file mode 100644 index 00000000000..bb56903075c --- /dev/null +++ b/compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/FunctionWithParameterToUnit.kt @@ -0,0 +1,91 @@ +// IGNORE_BACKEND: NATIVE +// IGNORE_BACKEND: WASM +// IGNORE_BACKEND: JS, JS_IR, JS_IR_ES6 +// IGNORE_LIGHT_ANALYSIS + +// CHECK_TYPE_WITH_EXACT + +class Buildee { + fun yield(arg: CT) {} + fun materialize(): CT = { _: UserKlass -> } as CT +} + +fun build( + instructions: Buildee.() -> Unit +): Buildee { + return Buildee().apply(instructions) +} + +class UserKlass + +// test 1: PTV is in consuming position (yield-case) +fun testYield() { + fun testBasicCase() { + val arg: (UserKlass) -> Unit = { _: UserKlass -> } + val buildee = build { + yield(arg) + } + checkExactType Unit>>(buildee) + } + + fun testExplicitlyUnaryLiterals() { + fun test1() { + val buildee = build { + yield { _: UserKlass -> } + } + checkExactType Unit>>(buildee) + } + fun test2() { + val buildee = build { + yield(fun(_: UserKlass) {}) + } + checkExactType Unit>>(buildee) + } + + test1() + test2() + } + + testBasicCase() + testExplicitlyUnaryLiterals() +} + +// test 2: PTV is in producing position (materialize-case) +fun testMaterialize() { + fun testBasicCase() { + fun consume(arg: (UserKlass) -> Unit) {} + val buildee = build { + consume(materialize()) + } + checkExactType Unit>>(buildee) + } + + fun testExplicitlyUnaryLiterals() { + fun test1() { + fun shareTypeInfo(from: T, to: T) {} + val buildee = build { + shareTypeInfo({ _: UserKlass -> }, materialize()) + } + checkExactType Unit>>(buildee) + } + fun test2() { + fun shareTypeInfo(from: T, to: T) {} + val buildee = build { + shareTypeInfo(fun(_: UserKlass) {}, materialize()) + } + checkExactType Unit>>(buildee) + } + + test1() + test2() + } + + testBasicCase() + testExplicitlyUnaryLiterals() +} + +fun box(): String { + testYield() + testMaterialize() + return "OK" +} diff --git a/compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/FunctionWithReceiverToUnit.kt b/compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/FunctionWithReceiverToUnit.kt new file mode 100644 index 00000000000..971e3e78c31 --- /dev/null +++ b/compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/FunctionWithReceiverToUnit.kt @@ -0,0 +1,68 @@ +// IGNORE_BACKEND: NATIVE +// IGNORE_BACKEND: WASM +// IGNORE_BACKEND: JS, JS_IR, JS_IR_ES6 +// IGNORE_LIGHT_ANALYSIS + +// CHECK_TYPE_WITH_EXACT + +class Buildee { + fun yield(arg: CT) {} + fun materialize(): CT = fun UserKlass.() {} as CT +} + +fun build( + instructions: Buildee.() -> Unit +): Buildee { + return Buildee().apply(instructions) +} + +class UserKlass + +// test 1: PTV is in consuming position (yield-case) +fun testYield() { + fun testBasicCase() { + val arg: UserKlass.() -> Unit = fun UserKlass.() {} + val buildee = build { + yield(arg) + } + checkExactType Unit>>(buildee) + } + + fun testLiteralWithExplicitlyPresentReceiver() { + val buildee = build { + yield(fun UserKlass.() {}) + } + checkExactType Unit>>(buildee) + } + + testBasicCase() + testLiteralWithExplicitlyPresentReceiver() +} + +// test 2: PTV is in producing position (materialize-case) +fun testMaterialize() { + fun testBasicCase() { + fun consume(arg: UserKlass.() -> Unit) {} + val buildee = build { + consume(materialize()) + } + checkExactType Unit>>(buildee) + } + + fun testLiteralWithExplicitlyPresentReceiver() { + fun shareTypeInfo(from: T, to: T) {} + val buildee = build { + shareTypeInfo(fun UserKlass.() {}, materialize()) + } + checkExactType Unit>>(buildee) + } + + testBasicCase() + testLiteralWithExplicitlyPresentReceiver() +} + +fun box(): String { + testYield() + testMaterialize() + return "OK" +} diff --git a/compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericLocalClass.kt b/compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericLocalClass.kt new file mode 100644 index 00000000000..a8ae8849b7d --- /dev/null +++ b/compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericLocalClass.kt @@ -0,0 +1,124 @@ +// IGNORE_BACKEND: NATIVE +// IGNORE_BACKEND: WASM +// IGNORE_BACKEND: JS, JS_IR, JS_IR_ES6 +// IGNORE_LIGHT_ANALYSIS + +// CHECK_TYPE_WITH_EXACT + +class Buildee { + fun yield(arg: CT) {} + fun materialize(): CT = reference as CT +} + +fun build( + instructions: Buildee.() -> Unit +): Buildee { + return Buildee().apply(instructions) +} + +private var reference: Any? = null +val Buildee.typeArgumentValue: T get() = reference as T + +class UserKlass + +// test 1: PTV is in consuming position (yield-case) +fun testYield() { + fun testLocalClassOutsideBuilderArgument() { + class Local + reference = Local() + + val arg: Local = Local() + val buildee = build { + yield(arg) + } + checkExactType>>(buildee) + } + + fun testLocalClassInsideBuilderArgument() { + val buildee = build { + class Local { fun localOnlyFunc(): T = UserKlass() as T } + reference = Local() + + val arg: Local = Local() + yield(arg) + } + val result = buildee.typeArgumentValue.localOnlyFunc() + checkExactType(result) + } + + fun testTypeInfoOriginInsideLocalClass() { + val buildee = build { + class Local { + fun localOnlyFunc(): T = UserKlass() as T + + fun initialize() { + reference = Local() + + val arg: Local = Local() + yield(arg) + } + } + Local().initialize() + } + val result = buildee.typeArgumentValue.localOnlyFunc() + checkExactType(result) + } + + testLocalClassOutsideBuilderArgument() + testLocalClassInsideBuilderArgument() + testTypeInfoOriginInsideLocalClass() +} + +// test 2: PTV is in producing position (materialize-case) +fun testMaterialize() { + fun testLocalClassOutsideBuilderArgument() { + class Local + reference = Local() + + fun consume(arg: Local) {} + val buildee = build { + consume(materialize()) + } + checkExactType>>(buildee) + } + + fun testLocalClassInsideBuilderArgument() { + val buildee = build { + class Local { fun localOnlyFunc(): T = UserKlass() as T } + reference = Local() + + fun consume(arg: Local) {} + consume(materialize()) + } + val result = buildee.typeArgumentValue.localOnlyFunc() + checkExactType(result) + } + + fun testTypeInfoOriginInsideLocalClass() { + val buildee = build { + class Local { + fun localOnlyFunc(): T = UserKlass() as T + + fun initialize() { + reference = Local() + + fun consume(arg: Local) {} + consume(materialize()) + } + } + Local().initialize() + } + val result = buildee.typeArgumentValue.localOnlyFunc() + checkExactType(result) + } + + testLocalClassOutsideBuilderArgument() + testLocalClassInsideBuilderArgument() + testTypeInfoOriginInsideLocalClass() +} + +fun box(): String { + testYield() + testMaterialize() + return "OK" +} diff --git a/compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericLocalClassWithLeakingTypeParameter.kt b/compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericLocalClassWithLeakingTypeParameter.kt new file mode 100644 index 00000000000..c2e286d8f11 --- /dev/null +++ b/compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericLocalClassWithLeakingTypeParameter.kt @@ -0,0 +1,119 @@ +// IGNORE_BACKEND: JVM +/* ^ code compiled by legacy JVM backend fails in run-time with + * NoSuchMethodError: GenericLocalClassWithLeakingTypeParameterKt$testYield$1$buildee$1$Local: method ()V not found + */ + +// ISSUE: KT-60855 +/* ATTENTION: + * this test monitors an unfixed compiler bug; + * if the behavior of the test changes, please consult with the linked YT ticket + * to check whether the described problem has been fixed by your changes; + * if the issue isn't actually fixed but new behavior persists, + * please add a comment about the behavior change to the ticket + * (preferably accompanied by an analysis of the change's reasons) + */ + +class Buildee { + fun yield(arg: CT) {} + fun materialize(): CT = reference as CT +} + +fun build( + instructions: Buildee.() -> Unit +): Buildee { + return Buildee().apply(instructions) +} + +private var reference: Any? = null +val Buildee.typeArgumentValue: T get() = reference as T + +class UserKlass + +// test 1: PTV is in consuming position (yield-case) +fun testYield() { + fun testTypeInfoOriginInsideLocalClass() { + val buildee = build { + class Local { + fun localOnlyFunc(): T = UserKlass() as T + + fun initialize() { + reference = Local() + + val arg: Local = Local() + yield(arg) + } + } + Local().initialize() + } + val result = buildee.typeArgumentValue.localOnlyFunc() + result + } + + fun testThisExpression() { + val buildee = build { + class Local { + fun localOnlyFunc(): T = UserKlass() as T + + fun initialize() { + reference = this + + yield(this) + } + } + Local().initialize() + } + val result = buildee.typeArgumentValue.localOnlyFunc() + result + } + + testTypeInfoOriginInsideLocalClass() + testThisExpression() +} + +// test 2: PTV is in producing position (materialize-case) +fun testMaterialize() { + fun testTypeInfoOriginInsideLocalClass() { + val buildee = build { + class Local { + fun localOnlyFunc(): T = UserKlass() as T + + fun initialize() { + reference = Local() + + fun consume(arg: Local) {} + consume(materialize()) + } + } + Local().initialize() + } + val result = buildee.typeArgumentValue.localOnlyFunc() + result + } + + fun testThisExpression() { + val buildee = build { + class Local { + fun localOnlyFunc(): T = UserKlass() as T + + fun initialize() { + reference = this + + fun shareTypeInfo(from: T, to: T) {} + shareTypeInfo(this, materialize()) + } + } + Local().initialize() + } + val result = buildee.typeArgumentValue.localOnlyFunc() + result + } + + testTypeInfoOriginInsideLocalClass() + testThisExpression() +} + +fun box(): String { + testYield() + testMaterialize() + return "OK" +} diff --git a/compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithContravariantTypeParameter.kt b/compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithContravariantTypeParameter.kt new file mode 100644 index 00000000000..fbb21cf4bf8 --- /dev/null +++ b/compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithContravariantTypeParameter.kt @@ -0,0 +1,45 @@ +// IGNORE_BACKEND: NATIVE +// IGNORE_BACKEND: WASM +// IGNORE_BACKEND: JS, JS_IR, JS_IR_ES6 +// IGNORE_LIGHT_ANALYSIS + +// CHECK_TYPE_WITH_EXACT + +class Buildee { + fun yield(arg: CT) {} + fun materialize(): CT = In() as CT +} + +fun build( + instructions: Buildee.() -> Unit +): Buildee { + return Buildee().apply(instructions) +} + +class In +open class UserSuperklass +open class UserKlass: UserSuperklass() + +// test 1: PTV is in consuming position (yield-case) +fun testYield() { + val arg: In = In() + val buildee = build { + yield(arg) + } + checkExactType>>(buildee) +} + +// test 2: PTV is in producing position (materialize-case) +fun testMaterialize() { + fun consume(arg: In) {} + val buildee = build { + consume(materialize()) + } + checkExactType>>(buildee) +} + +fun box(): String { + testYield() + testMaterialize() + return "OK" +} diff --git a/compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithCovariantTypeParameter.kt b/compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithCovariantTypeParameter.kt new file mode 100644 index 00000000000..f6680a98cfa --- /dev/null +++ b/compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithCovariantTypeParameter.kt @@ -0,0 +1,45 @@ +// IGNORE_BACKEND: NATIVE +// IGNORE_BACKEND: WASM +// IGNORE_BACKEND: JS, JS_IR, JS_IR_ES6 +// IGNORE_LIGHT_ANALYSIS + +// CHECK_TYPE_WITH_EXACT + +class Buildee { + fun yield(arg: CT) {} + fun materialize(): CT = Out() as CT +} + +fun build( + instructions: Buildee.() -> Unit +): Buildee { + return Buildee().apply(instructions) +} + +class Out +open class UserKlass +open class UserSubklass: UserKlass() + +// test 1: PTV is in consuming position (yield-case) +fun testYield() { + val arg: Out = Out() + val buildee = build { + yield(arg) + } + checkExactType>>(buildee) +} + +// test 2: PTV is in producing position (materialize-case) +fun testMaterialize() { + fun consume(arg: Out) {} + val buildee = build { + consume(materialize()) + } + checkExactType>>(buildee) +} + +fun box(): String { + testYield() + testMaterialize() + return "OK" +} diff --git a/compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithInProjectedTypeArgument.kt b/compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithInProjectedTypeArgument.kt new file mode 100644 index 00000000000..6847a1068c4 --- /dev/null +++ b/compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithInProjectedTypeArgument.kt @@ -0,0 +1,45 @@ +// IGNORE_BACKEND: NATIVE +// IGNORE_BACKEND: WASM +// IGNORE_BACKEND: JS, JS_IR, JS_IR_ES6 +// IGNORE_LIGHT_ANALYSIS + +// CHECK_TYPE_WITH_EXACT + +class Buildee { + fun yield(arg: CT) {} + fun materialize(): CT = Inv() as CT +} + +fun build( + instructions: Buildee.() -> Unit +): Buildee { + return Buildee().apply(instructions) +} + +class Inv +open class UserSuperklass +open class UserKlass: UserSuperklass() + +// test 1: PTV is in consuming position (yield-case) +fun testYield() { + val arg: Inv = Inv() + val buildee = build { + yield(arg) + } + checkExactType>>(buildee) +} + +// test 2: PTV is in producing position (materialize-case) +fun testMaterialize() { + fun consume(arg: Inv) {} + val buildee = build { + consume(materialize()) + } + checkExactType>>(buildee) +} + +fun box(): String { + testYield() + testMaterialize() + return "OK" +} diff --git a/compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithInvariantTypeParameter.kt b/compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithInvariantTypeParameter.kt new file mode 100644 index 00000000000..3fba2ef0909 --- /dev/null +++ b/compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithInvariantTypeParameter.kt @@ -0,0 +1,44 @@ +// IGNORE_BACKEND: NATIVE +// IGNORE_BACKEND: WASM +// IGNORE_BACKEND: JS, JS_IR, JS_IR_ES6 +// IGNORE_LIGHT_ANALYSIS + +// CHECK_TYPE_WITH_EXACT + +class Buildee { + fun yield(arg: CT) {} + fun materialize(): CT = Inv() as CT +} + +fun build( + instructions: Buildee.() -> Unit +): Buildee { + return Buildee().apply(instructions) +} + +class Inv +class UserKlass + +// test 1: PTV is in consuming position (yield-case) +fun testYield() { + val arg: Inv = Inv() + val buildee = build { + yield(arg) + } + checkExactType>>(buildee) +} + +// test 2: PTV is in producing position (materialize-case) +fun testMaterialize() { + fun consume(arg: Inv) {} + val buildee = build { + consume(materialize()) + } + checkExactType>>(buildee) +} + +fun box(): String { + testYield() + testMaterialize() + return "OK" +} diff --git a/compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithOutProjectedTypeArgument.kt b/compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithOutProjectedTypeArgument.kt new file mode 100644 index 00000000000..b9aa2039b98 --- /dev/null +++ b/compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithOutProjectedTypeArgument.kt @@ -0,0 +1,45 @@ +// IGNORE_BACKEND: NATIVE +// IGNORE_BACKEND: WASM +// IGNORE_BACKEND: JS, JS_IR, JS_IR_ES6 +// IGNORE_LIGHT_ANALYSIS + +// CHECK_TYPE_WITH_EXACT + +class Buildee { + fun yield(arg: CT) {} + fun materialize(): CT = Inv() as CT +} + +fun build( + instructions: Buildee.() -> Unit +): Buildee { + return Buildee().apply(instructions) +} + +class Inv +open class UserKlass +open class UserSubklass: UserKlass() + +// test 1: PTV is in consuming position (yield-case) +fun testYield() { + val arg: Inv = Inv() + val buildee = build { + yield(arg) + } + checkExactType>>(buildee) +} + +// test 2: PTV is in producing position (materialize-case) +fun testMaterialize() { + fun consume(arg: Inv) {} + val buildee = build { + consume(materialize()) + } + checkExactType>>(buildee) +} + +fun box(): String { + testYield() + testMaterialize() + return "OK" +} diff --git a/compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithStarProjectedTypeArgument.kt b/compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithStarProjectedTypeArgument.kt new file mode 100644 index 00000000000..889834e53dc --- /dev/null +++ b/compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithStarProjectedTypeArgument.kt @@ -0,0 +1,43 @@ +// IGNORE_BACKEND: NATIVE +// IGNORE_BACKEND: WASM +// IGNORE_BACKEND: JS, JS_IR, JS_IR_ES6 +// IGNORE_LIGHT_ANALYSIS + +// CHECK_TYPE_WITH_EXACT + +class Buildee { + fun yield(arg: CT) {} + fun materialize(): CT = Inv() as CT +} + +fun build( + instructions: Buildee.() -> Unit +): Buildee { + return Buildee().apply(instructions) +} + +class Inv + +// test 1: PTV is in consuming position (yield-case) +fun testYield() { + val arg: Inv<*> = Inv() + val buildee = build { + yield(arg) + } + checkExactType>>(buildee) +} + +// test 2: PTV is in producing position (materialize-case) +fun testMaterialize() { + fun consume(arg: Inv<*>) {} + val buildee = build { + consume(materialize()) + } + checkExactType>>(buildee) +} + +fun box(): String { + testYield() + testMaterialize() + return "OK" +} diff --git a/compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/ImplicitlyGenericInnerClass.kt b/compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/ImplicitlyGenericInnerClass.kt new file mode 100644 index 00000000000..a106c8d3e47 --- /dev/null +++ b/compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/ImplicitlyGenericInnerClass.kt @@ -0,0 +1,46 @@ +// IGNORE_BACKEND: NATIVE +// IGNORE_BACKEND: WASM +// IGNORE_BACKEND: JS, JS_IR, JS_IR_ES6 +// IGNORE_LIGHT_ANALYSIS + +// CHECK_TYPE_WITH_EXACT + +class Buildee { + fun yield(arg: CT) {} + fun materialize(): CT = UserKlass().Inner() as CT +} + +fun build( + instructions: Buildee.() -> Unit +): Buildee { + return Buildee().apply(instructions) +} + +class UserKlass { + inner class Inner +} +class Placeholder + +// test 1: PTV is in consuming position (yield-case) +fun testYield() { + val arg: UserKlass.Inner = UserKlass().Inner() + val buildee = build { + yield(arg) + } + checkExactType.Inner>>(buildee) +} + +// test 2: PTV is in producing position (materialize-case) +fun testMaterialize() { + fun consume(arg: UserKlass.Inner) {} + val buildee = build { + consume(materialize()) + } + checkExactType.Inner>>(buildee) +} + +fun box(): String { + testYield() + testMaterialize() + return "OK" +} diff --git a/compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/InnerClass.kt b/compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/InnerClass.kt new file mode 100644 index 00000000000..a1cdcd5865b --- /dev/null +++ b/compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/InnerClass.kt @@ -0,0 +1,45 @@ +// IGNORE_BACKEND: NATIVE +// IGNORE_BACKEND: WASM +// IGNORE_BACKEND: JS, JS_IR, JS_IR_ES6 +// IGNORE_LIGHT_ANALYSIS + +// CHECK_TYPE_WITH_EXACT + +class Buildee { + fun yield(arg: CT) {} + fun materialize(): CT = UserKlass().Inner() as CT +} + +fun build( + instructions: Buildee.() -> Unit +): Buildee { + return Buildee().apply(instructions) +} + +class UserKlass { + inner class Inner +} + +// test 1: PTV is in consuming position (yield-case) +fun testYield() { + val arg: UserKlass.Inner = UserKlass().Inner() + val buildee = build { + yield(arg) + } + checkExactType>(buildee) +} + +// test 2: PTV is in producing position (materialize-case) +fun testMaterialize() { + fun consume(arg: UserKlass.Inner) {} + val buildee = build { + consume(materialize()) + } + checkExactType>(buildee) +} + +fun box(): String { + testYield() + testMaterialize() + return "OK" +} diff --git a/compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/Int.kt b/compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/Int.kt new file mode 100644 index 00000000000..b75ee454ad5 --- /dev/null +++ b/compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/Int.kt @@ -0,0 +1,104 @@ +// IGNORE_BACKEND: NATIVE +// IGNORE_BACKEND: WASM +// IGNORE_BACKEND: JS, JS_IR, JS_IR_ES6 +// IGNORE_LIGHT_ANALYSIS + +// CHECK_TYPE_WITH_EXACT + +class Buildee { + fun yield(arg: CT) {} + fun materialize(): CT = 42 as CT +} + +fun build( + instructions: Buildee.() -> Unit +): Buildee { + return Buildee().apply(instructions) +} + +// test 1: PTV is in consuming position (yield-case) +fun testYield() { + fun testBasicCase() { + val arg: Int = 42 + val buildee = build { + yield(arg) + } + checkExactType>(buildee) + } + + fun testLiterals() { + fun test1() { + val buildee = build { + yield(42) + } + checkExactType>(buildee) + } + fun test2() { + val buildee = build { + yield(0x13) + } + checkExactType>(buildee) + } + fun test3() { + val buildee = build { + yield(0b1000) + } + checkExactType>(buildee) + } + + test1() + test2() + test3() + } + + testBasicCase() + testLiterals() +} + +// test 2: PTV is in producing position (materialize-case) +fun testMaterialize() { + fun testBasicCase() { + fun consume(arg: Int) {} + val buildee = build { + consume(materialize()) + } + checkExactType>(buildee) + } + + fun testLiterals() { + fun test1() { + fun shareTypeInfo(from: T, to: T) {} + val buildee = build { + shareTypeInfo(42, materialize()) + } + checkExactType>(buildee) + } + fun test2() { + fun shareTypeInfo(from: T, to: T) {} + val buildee = build { + shareTypeInfo(0x13, materialize()) + } + checkExactType>(buildee) + } + fun test3() { + fun shareTypeInfo(from: T, to: T) {} + val buildee = build { + shareTypeInfo(0b1000, materialize()) + } + checkExactType>(buildee) + } + + test1() + test2() + test3() + } + + testBasicCase() + testLiterals() +} + +fun box(): String { + testYield() + testMaterialize() + return "OK" +} diff --git a/compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/IntersectionType.kt b/compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/IntersectionType.kt new file mode 100644 index 00000000000..ca8effbde15 --- /dev/null +++ b/compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/IntersectionType.kt @@ -0,0 +1,52 @@ +// IGNORE_BACKEND: NATIVE +// IGNORE_BACKEND: WASM +// IGNORE_BACKEND: JS, JS_IR, JS_IR_ES6 +// IGNORE_LIGHT_ANALYSIS + +// CHECK_TYPE_WITH_EXACT + +class Buildee { + fun yield(arg: CT) {} + fun materialize(): CT = reference as CT +} + +fun build( + instructions: Buildee.() -> Unit +): Buildee { + return Buildee().apply(instructions) +} + +private var reference: Any? = null +val Buildee.typeArgumentValue: T get() = reference as T + +interface I1 +interface I2 +object A: I1, I2 +object B: I1, I2 + +fun select(vararg arg: T): T = arg[0] + +// test 1: PTV is in consuming position (yield-case) +fun testYield() { + val intersection = select(A, B) + val buildee = build { + yield(intersection) + } + checkTypeEquality(intersection, buildee.typeArgumentValue) +} + +// test 2: PTV is in producing position (materialize-case) +fun testMaterialize() { + val intersection = select(A, B) + val buildee = build { + fun shareTypeInfo(from: T, to: T) {} + shareTypeInfo(intersection, materialize()) + } + checkTypeEquality(intersection, buildee.typeArgumentValue) +} + +fun box(): String { + testYield() + testMaterialize() + return "OK" +} diff --git a/compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/LocalClass.kt b/compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/LocalClass.kt new file mode 100644 index 00000000000..12ce2261626 --- /dev/null +++ b/compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/LocalClass.kt @@ -0,0 +1,153 @@ +// IGNORE_BACKEND: NATIVE +// IGNORE_BACKEND: WASM +// IGNORE_BACKEND: JS, JS_IR, JS_IR_ES6 +// IGNORE_LIGHT_ANALYSIS + +// CHECK_TYPE_WITH_EXACT + +class Buildee { + fun yield(arg: CT) {} + fun materialize(): CT = reference as CT +} + +fun build( + instructions: Buildee.() -> Unit +): Buildee { + return Buildee().apply(instructions) +} + +private var reference: Any? = null +val Buildee.typeArgumentValue: T get() = reference as T + +// test 1: PTV is in consuming position (yield-case) +fun testYield() { + fun testLocalClassOutsideBuilderArgument() { + class Local + reference = Local() + + val arg: Local = Local() + val buildee = build { + yield(arg) + } + checkExactType>(buildee) + } + + fun testLocalClassInsideBuilderArgument() { + val buildee = build { + class Local { fun localOnlyFunc() {} } + reference = Local() + + val arg: Local = Local() + yield(arg) + } + buildee.typeArgumentValue.localOnlyFunc() + } + + fun testTypeInfoOriginInsideLocalClass() { + val buildee = build { + class Local { + fun localOnlyFunc() {} + + fun initialize() { + reference = Local() + + val arg: Local = Local() + yield(arg) + } + } + Local().initialize() + } + buildee.typeArgumentValue.localOnlyFunc() + } + + fun testThisExpression() { + val buildee = build { + class Local { + fun localOnlyFunc() {} + + fun initialize() { + reference = this + + yield(this) + } + } + Local().initialize() + } + buildee.typeArgumentValue.localOnlyFunc() + } + + testLocalClassOutsideBuilderArgument() + testLocalClassInsideBuilderArgument() + testTypeInfoOriginInsideLocalClass() + testThisExpression() +} + +// test 2: PTV is in producing position (materialize-case) +fun testMaterialize() { + fun testLocalClassOutsideBuilderArgument() { + class Local + reference = Local() + + fun consume(arg: Local) {} + val buildee = build { + consume(materialize()) + } + checkExactType>(buildee) + } + + fun testLocalClassInsideBuilderArgument() { + val buildee = build { + class Local { fun localOnlyFunc() {} } + reference = Local() + + fun consume(arg: Local) {} + consume(materialize()) + } + buildee.typeArgumentValue.localOnlyFunc() + } + + fun testTypeInfoOriginInsideLocalClass() { + val buildee = build { + class Local { + fun localOnlyFunc() {} + + fun initialize() { + reference = Local() + + fun consume(arg: Local) {} + consume(materialize()) + } + } + Local().initialize() + } + buildee.typeArgumentValue.localOnlyFunc() + } + + fun testThisExpression() { + val buildee = build { + class Local { + fun localOnlyFunc() {} + + fun initialize() { + reference = this + + fun shareTypeInfo(from: T, to: T) {} + shareTypeInfo(this, materialize()) + } + } + Local().initialize() + } + buildee.typeArgumentValue.localOnlyFunc() + } + + testLocalClassOutsideBuilderArgument() + testLocalClassInsideBuilderArgument() + testTypeInfoOriginInsideLocalClass() + testThisExpression() +} + +fun box(): String { + testYield() + testMaterialize() + return "OK" +} diff --git a/compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NothingYieldCase.kt b/compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NothingYieldCase.kt new file mode 100644 index 00000000000..196ac03512e --- /dev/null +++ b/compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NothingYieldCase.kt @@ -0,0 +1,32 @@ +// IGNORE_BACKEND: NATIVE +// IGNORE_BACKEND: WASM +// IGNORE_BACKEND: JS, JS_IR, JS_IR_ES6 +// IGNORE_LIGHT_ANALYSIS + +// CHECK_TYPE_WITH_EXACT + +import kotlin.IllegalStateException + +class Buildee { + fun yield(arg: CT) {} +} + +fun build( + instructions: Buildee.() -> Unit +): Buildee { + return Buildee().apply(instructions) +} + +fun testYield() { + val buildee = build { + try { + yield(throw IllegalStateException()) + } catch (e: IllegalStateException) {} + } + checkExactType>(buildee) +} + +fun box(): String { + testYield() + return "OK" +} diff --git a/compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullableNothing.kt b/compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullableNothing.kt new file mode 100644 index 00000000000..5f43747baf7 --- /dev/null +++ b/compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullableNothing.kt @@ -0,0 +1,41 @@ +// IGNORE_BACKEND: NATIVE +// IGNORE_BACKEND: WASM +// IGNORE_BACKEND: JS, JS_IR, JS_IR_ES6 +// IGNORE_LIGHT_ANALYSIS + +// CHECK_TYPE_WITH_EXACT + +class Buildee { + fun yield(arg: CT) {} + fun materialize(): CT = null as CT +} + +fun build( + instructions: Buildee.() -> Unit +): Buildee { + return Buildee().apply(instructions) +} + +// test 1: PTV is in consuming position (yield-case) +fun testYield() { + val arg: Nothing? = null + val buildee = build { + yield(arg) + } + checkExactType>(buildee) +} + +// test 2: PTV is in producing position (materialize-case) +fun testMaterialize() { + fun consume(arg: Nothing?) {} + val buildee = build { + consume(materialize()) + } + checkExactType>(buildee) +} + +fun box(): String { + testYield() + testMaterialize() + return "OK" +} diff --git a/compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullableNothingNullLiteralYieldCase.kt b/compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullableNothingNullLiteralYieldCase.kt new file mode 100644 index 00000000000..b6e47583c3c --- /dev/null +++ b/compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullableNothingNullLiteralYieldCase.kt @@ -0,0 +1,28 @@ +// IGNORE_BACKEND: NATIVE +// IGNORE_BACKEND: WASM +// IGNORE_BACKEND: JS, JS_IR, JS_IR_ES6 +// IGNORE_LIGHT_ANALYSIS + +// CHECK_TYPE_WITH_EXACT + +class Buildee { + fun yield(arg: CT) {} +} + +fun build( + instructions: Buildee.() -> Unit +): Buildee { + return Buildee().apply(instructions) +} + +fun testYield() { + val buildee = build { + yield(null) + } + checkExactType>(buildee) +} + +fun box(): String { + testYield() + return "OK" +} diff --git a/compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullableType.kt b/compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullableType.kt new file mode 100644 index 00000000000..4d18675a0e7 --- /dev/null +++ b/compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullableType.kt @@ -0,0 +1,43 @@ +// IGNORE_BACKEND: NATIVE +// IGNORE_BACKEND: WASM +// IGNORE_BACKEND: JS, JS_IR, JS_IR_ES6 +// IGNORE_LIGHT_ANALYSIS + +// CHECK_TYPE_WITH_EXACT + +class Buildee { + fun yield(arg: CT) {} + fun materialize(): CT = null as CT +} + +fun build( + instructions: Buildee.() -> Unit +): Buildee { + return Buildee().apply(instructions) +} + +class UserKlass + +// test 1: PTV is in consuming position (yield-case) +fun testYield() { + val arg: UserKlass? = null + val buildee = build { + yield(arg) + } + checkExactType>(buildee) +} + +// test 2: PTV is in producing position (materialize-case) +fun testMaterialize() { + fun consume(arg: UserKlass?) {} + val buildee = build { + consume(materialize()) + } + checkExactType>(buildee) +} + +fun box(): String { + testYield() + testMaterialize() + return "OK" +} diff --git a/compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullableTypeParameter.kt b/compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullableTypeParameter.kt new file mode 100644 index 00000000000..e685b52c914 --- /dev/null +++ b/compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullableTypeParameter.kt @@ -0,0 +1,47 @@ +// IGNORE_BACKEND: NATIVE +// IGNORE_BACKEND: WASM +// IGNORE_BACKEND: JS, JS_IR, JS_IR_ES6 +// IGNORE_LIGHT_ANALYSIS + +// CHECK_TYPE_WITH_EXACT + +class Buildee { + fun yield(arg: CT) {} + fun materialize(): CT = null as CT +} + +fun build( + instructions: Buildee.() -> Unit +): Buildee { + return Buildee().apply(instructions) +} + +class UserKlass + +class Context { + // test 1: PTV is in consuming position (yield-case) + fun testYield() { + val arg: T? = null + val buildee = build { + yield(arg) + } + checkExactType>(buildee) + } + + // test 2: PTV is in producing position (materialize-case) + fun testMaterialize() { + fun consume(arg: T?) {} + val buildee = build { + consume(materialize()) + } + checkExactType>(buildee) + } +} + +fun box(): String { + with(Context()) { + testYield() + testMaterialize() + } + return "OK" +} diff --git a/compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullaryFunctionToUnit.kt b/compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullaryFunctionToUnit.kt new file mode 100644 index 00000000000..8843b1c7c3a --- /dev/null +++ b/compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullaryFunctionToUnit.kt @@ -0,0 +1,104 @@ +// IGNORE_BACKEND: NATIVE +// IGNORE_BACKEND: WASM +// IGNORE_BACKEND: JS, JS_IR, JS_IR_ES6 +// IGNORE_LIGHT_ANALYSIS + +// CHECK_TYPE_WITH_EXACT + +class Buildee { + fun yield(arg: CT) {} + fun materialize(): CT = { -> } as CT +} + +fun build( + instructions: Buildee.() -> Unit +): Buildee { + return Buildee().apply(instructions) +} + +// test 1: PTV is in consuming position (yield-case) +fun testYield() { + fun testBasicCase() { + val arg: () -> Unit = { -> } + val buildee = build { + yield(arg) + } + checkExactType Unit>>(buildee) + } + + fun testLiterals() { + fun test1() { + val buildee = build { + yield { -> } + } + checkExactType Unit>>(buildee) + } + fun test2() { + val buildee = build { + yield(fun() {}) + } + checkExactType Unit>>(buildee) + } + fun test3() { + val buildee = build { + yield {} + } + checkExactType Unit>>(buildee) + } + + test1() + test2() + test3() + } + + testBasicCase() + testLiterals() +} + +// test 2: PTV is in producing position (materialize-case) +fun testMaterialize() { + fun testBasicCase() { + fun consume(arg: () -> Unit) {} + val buildee = build { + consume(materialize()) + } + checkExactType Unit>>(buildee) + } + + fun testLiterals() { + fun test1() { + fun shareTypeInfo(from: T, to: T) {} + val buildee = build { + shareTypeInfo({ -> }, materialize()) + } + checkExactType Unit>>(buildee) + } + fun test2() { + fun shareTypeInfo(from: T, to: T) {} + val buildee = build { + shareTypeInfo(fun() {}, materialize()) + } + checkExactType Unit>>(buildee) + } + fun test3() { + fun shareTypeInfo(from: T, to: T) {} + val buildee = build { + shareTypeInfo({}, materialize()) + } + checkExactType Unit>>(buildee) + } + + test1() + test2() + test3() + } + + testBasicCase() + testLiterals() +} + +fun box(): String { + testYield() + testMaterialize() + return "OK" +} diff --git a/compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullaryFunctionWithReturnValue.kt b/compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullaryFunctionWithReturnValue.kt new file mode 100644 index 00000000000..75ade057d76 --- /dev/null +++ b/compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullaryFunctionWithReturnValue.kt @@ -0,0 +1,127 @@ +// IGNORE_BACKEND: NATIVE +// IGNORE_BACKEND: WASM +// IGNORE_BACKEND: JS, JS_IR, JS_IR_ES6 +// IGNORE_LIGHT_ANALYSIS + +// CHECK_TYPE_WITH_EXACT + +class Buildee { + fun yield(arg: CT) {} + fun materialize(): CT = l@ { return@l UserKlass() } as CT +} + +fun build( + instructions: Buildee.() -> Unit +): Buildee { + return Buildee().apply(instructions) +} + +class UserKlass + +// test 1: PTV is in consuming position (yield-case) +fun testYield() { + fun testBasicCase() { + val arg: () -> UserKlass = l@ { return@l UserKlass() } + val buildee = build { + yield(arg) + } + checkExactType UserKlass>>(buildee) + } + + fun testLiterals() { + fun test1() { + val buildee = build { + yield { return@yield UserKlass() } + } + checkExactType UserKlass>>(buildee) + } + fun test2() { + val buildee = build { + yield(fun(): UserKlass { return UserKlass() }) + } + checkExactType UserKlass>>(buildee) + } + fun test3() { + val buildee = build { + yield { UserKlass() } + } + checkExactType UserKlass>>(buildee) + } + fun test4() { + val buildee = build { + yield(fun() = UserKlass()) + } + checkExactType UserKlass>>(buildee) + } + + test1() + test2() + test3() + test4() + } + + testBasicCase() + testLiterals() +} + +// test 2: PTV is in producing position (materialize-case) +fun testMaterialize() { + fun testBasicCase() { + fun consume(arg: () -> UserKlass) {} + val buildee = build { + consume(materialize()) + } + checkExactType UserKlass>>(buildee) + } + + fun testLiterals() { + fun test1() { + fun shareTypeInfo(from: T, to: T) {} + val buildee = build { + shareTypeInfo( + { return@shareTypeInfo UserKlass() }, + materialize() + ) + } + checkExactType UserKlass>>(buildee) + } + fun test2() { + fun shareTypeInfo(from: T, to: T) {} + val buildee = build { + shareTypeInfo( + fun(): UserKlass { return UserKlass() }, + materialize() + ) + } + checkExactType UserKlass>>(buildee) + } + fun test3() { + fun shareTypeInfo(from: T, to: T) {} + val buildee = build { + shareTypeInfo({ UserKlass() }, materialize()) + } + checkExactType UserKlass>>(buildee) + } + fun test4() { + fun shareTypeInfo(from: T, to: T) {} + val buildee = build { + shareTypeInfo(fun() = UserKlass(), materialize()) + } + checkExactType UserKlass>>(buildee) + } + + test1() + test2() + test3() + test4() + } + + testBasicCase() + testLiterals() +} + +fun box(): String { + testYield() + testMaterialize() + return "OK" +} diff --git a/compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/String.kt b/compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/String.kt new file mode 100644 index 00000000000..a4797eb10e9 --- /dev/null +++ b/compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/String.kt @@ -0,0 +1,104 @@ +// IGNORE_BACKEND: NATIVE +// IGNORE_BACKEND: WASM +// IGNORE_BACKEND: JS, JS_IR, JS_IR_ES6 +// IGNORE_LIGHT_ANALYSIS + +// CHECK_TYPE_WITH_EXACT + +class Buildee { + fun yield(arg: CT) {} + fun materialize(): CT = "42" as CT +} + +fun build( + instructions: Buildee.() -> Unit +): Buildee { + return Buildee().apply(instructions) +} + +// test 1: PTV is in consuming position (yield-case) +fun testYield() { + fun testBasicCase() { + val arg: String = "42" + val buildee = build { + yield(arg) + } + checkExactType>(buildee) + } + + fun testLiterals() { + fun test1() { + val buildee = build { + yield("42") + } + checkExactType>(buildee) + } + fun test2() { + val buildee = build { + yield("""42""") + } + checkExactType>(buildee) + } + fun test3() { + val buildee = build { + yield("${4}${2}") + } + checkExactType>(buildee) + } + + test1() + test2() + test3() + } + + testBasicCase() + testLiterals() +} + +// test 2: PTV is in producing position (materialize-case) +fun testMaterialize() { + fun testBasicCase() { + fun consume(arg: String) {} + val buildee = build { + consume(materialize()) + } + checkExactType>(buildee) + } + + fun testLiterals() { + fun test1() { + fun shareTypeInfo(from: T, to: T) {} + val buildee = build { + shareTypeInfo("42", materialize()) + } + checkExactType>(buildee) + } + fun test2() { + fun shareTypeInfo(from: T, to: T) {} + val buildee = build { + shareTypeInfo("""42""", materialize()) + } + checkExactType>(buildee) + } + fun test3() { + fun shareTypeInfo(from: T, to: T) {} + val buildee = build { + shareTypeInfo("${4}${2}", materialize()) + } + checkExactType>(buildee) + } + + test1() + test2() + test3() + } + + testBasicCase() + testLiterals() +} + +fun box(): String { + testYield() + testMaterialize() + return "OK" +} diff --git a/compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/SuspendingFunction.kt b/compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/SuspendingFunction.kt new file mode 100644 index 00000000000..f6e52b04be7 --- /dev/null +++ b/compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/SuspendingFunction.kt @@ -0,0 +1,68 @@ +// IGNORE_BACKEND: NATIVE +// IGNORE_BACKEND: WASM +// IGNORE_BACKEND: JS, JS_IR, JS_IR_ES6 +// IGNORE_LIGHT_ANALYSIS + +// CHECK_TYPE_WITH_EXACT + +// WITH_STDLIB + +class Buildee { + fun yield(arg: CT) {} + fun materialize(): CT = suspend {} as CT +} + +fun build( + instructions: Buildee.() -> Unit +): Buildee { + return Buildee().apply(instructions) +} + +// test 1: PTV is in consuming position (yield-case) +fun testYield() { + fun testBasicCase() { + val arg: suspend () -> Unit = suspend {} + val buildee = build { + yield(arg) + } + checkExactType Unit>>(buildee) + } + + fun testLiteral() { + val buildee = build { + yield(suspend {}) + } + checkExactType Unit>>(buildee) + } + + testBasicCase() + testLiteral() +} + +// test 2: PTV is in producing position (materialize-case) +fun testMaterialize() { + fun testBasicCase() { + fun consume(arg: suspend () -> Unit) {} + val buildee = build { + consume(materialize()) + } + checkExactType Unit>>(buildee) + } + + fun testLiteral() { + fun shareTypeInfo(from: T, to: T) {} + val buildee = build { + shareTypeInfo(suspend {}, materialize()) + } + checkExactType Unit>>(buildee) + } + + testBasicCase() + testLiteral() +} + +fun box(): String { + testYield() + testMaterialize() + return "OK" +} diff --git a/compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/TypeParameter.kt b/compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/TypeParameter.kt new file mode 100644 index 00000000000..494ce1536b6 --- /dev/null +++ b/compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/TypeParameter.kt @@ -0,0 +1,47 @@ +// IGNORE_BACKEND: NATIVE +// IGNORE_BACKEND: WASM +// IGNORE_BACKEND: JS, JS_IR, JS_IR_ES6 +// IGNORE_LIGHT_ANALYSIS + +// CHECK_TYPE_WITH_EXACT + +class Buildee { + fun yield(arg: CT) {} + fun materialize(): CT = UserKlass() as CT +} + +fun build( + instructions: Buildee.() -> Unit +): Buildee { + return Buildee().apply(instructions) +} + +class UserKlass + +class Context { + // test 1: PTV is in consuming position (yield-case) + fun testYield() { + val arg: T = UserKlass() as T + val buildee = build { + yield(arg) + } + checkExactType>(buildee) + } + + // test 2: PTV is in producing position (materialize-case) + fun testMaterialize() { + fun consume(arg: T) {} + val buildee = build { + consume(materialize()) + } + checkExactType>(buildee) + } +} + +fun box(): String { + with(Context()) { + testYield() + testMaterialize() + } + return "OK" +} diff --git a/compiler/testData/diagnostics/tests/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/FunctionWithParameterToUnitImplicitLiteralsCase.fir.kt b/compiler/testData/diagnostics/tests/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/FunctionWithParameterToUnitImplicitLiteralsCase.fir.kt new file mode 100644 index 00000000000..2305aae5818 --- /dev/null +++ b/compiler/testData/diagnostics/tests/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/FunctionWithParameterToUnitImplicitLiteralsCase.fir.kt @@ -0,0 +1,46 @@ +// DIAGNOSTICS: -UNCHECKED_CAST + +// CHECK_TYPE_WITH_EXACT + +// ISSUE: KT-60719 +/* ATTENTION: + * this test is supposed to monitor unclear feature behavior; + * an explicit design decision regarding said behavior has not been made at the moment of test creation; + * if the behavior of the test changes, please consult with the linked YT ticket + * and either add a comment about the change if an explicit design decision is still unavailable + * (preferably accompanied by an analysis of the change's reasons) + * or remove this disclaimer otherwise + */ + +class Buildee { + fun yield(arg: CT) {} + fun materialize(): CT = { _: UserKlass -> } as CT +} + +fun build( + instructions: Buildee.() -> Unit +): Buildee { + return Buildee().apply(instructions) +} + +class UserKlass + +// test 1: PTV is in consuming position (yield-case) +fun testYield() { + val buildee = build { + yield { val x: UserKlass = it } + } + checkExactType Unit>>(>; Buildee>")!>buildee) +} + +// test 2: PTV is in producing position (materialize-case) +fun testMaterialize() { + fun shareTypeInfo(from: T, to: T) {} + val buildee = build { + shareTypeInfo( + { val x: UserKlass = it }, + materialize() + ) + } + checkExactType Unit>>(>; Buildee>")!>buildee) +} diff --git a/compiler/testData/diagnostics/tests/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/FunctionWithParameterToUnitImplicitLiteralsCase.kt b/compiler/testData/diagnostics/tests/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/FunctionWithParameterToUnitImplicitLiteralsCase.kt new file mode 100644 index 00000000000..4d759f9cc64 --- /dev/null +++ b/compiler/testData/diagnostics/tests/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/FunctionWithParameterToUnitImplicitLiteralsCase.kt @@ -0,0 +1,46 @@ +// DIAGNOSTICS: -UNCHECKED_CAST + +// CHECK_TYPE_WITH_EXACT + +// ISSUE: KT-60719 +/* ATTENTION: + * this test is supposed to monitor unclear feature behavior; + * an explicit design decision regarding said behavior has not been made at the moment of test creation; + * if the behavior of the test changes, please consult with the linked YT ticket + * and either add a comment about the change if an explicit design decision is still unavailable + * (preferably accompanied by an analysis of the change's reasons) + * or remove this disclaimer otherwise + */ + +class Buildee { + fun yield(arg: CT) {} + fun materialize(): CT = { _: UserKlass -> } as CT +} + +fun build( + instructions: Buildee.() -> Unit +): Buildee { + return Buildee().apply(instructions) +} + +class UserKlass + +// test 1: PTV is in consuming position (yield-case) +fun testYield() { + val buildee = build { + yield { val x: UserKlass = it } + } + checkExactType Unit>>( Unit>; Buildee<() -> Unit>"), TYPE_MISMATCH("Buildee<() -> Unit>; Buildee<(UserKlass) -> Unit>")!>buildee) +} + +// test 2: PTV is in producing position (materialize-case) +fun testMaterialize() { + fun shareTypeInfo(from: T, to: T) {} + val buildee = build { + shareTypeInfo( + { val x: UserKlass = it }, + materialize() + ) + } + checkExactType Unit>>( Unit>; Buildee<() -> Unit>"), TYPE_MISMATCH("Buildee<() -> Unit>; Buildee<(UserKlass) -> Unit>")!>buildee) +} diff --git a/compiler/testData/diagnostics/tests/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/FunctionWithReceiverToUnitImplicitLiteralsCase.fir.kt b/compiler/testData/diagnostics/tests/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/FunctionWithReceiverToUnitImplicitLiteralsCase.fir.kt new file mode 100644 index 00000000000..7f70660d2f6 --- /dev/null +++ b/compiler/testData/diagnostics/tests/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/FunctionWithReceiverToUnitImplicitLiteralsCase.fir.kt @@ -0,0 +1,46 @@ +// DIAGNOSTICS: -UNCHECKED_CAST + +// CHECK_TYPE_WITH_EXACT + +// ISSUE: KT-60720 +/* ATTENTION: + * this test is supposed to monitor unclear feature behavior; + * an explicit design decision regarding said behavior has not been made at the moment of test creation; + * if the behavior of the test changes, please consult with the linked YT ticket + * and either add a comment about the change if an explicit design decision is still unavailable + * (preferably accompanied by an analysis of the change's reasons) + * or remove this disclaimer otherwise + */ + +class Buildee { + fun yield(arg: CT) {} + fun materialize(): CT = fun UserKlass.() {} as CT +} + +fun build( + instructions: Buildee.() -> Unit +): Buildee { + return Buildee().apply(instructions) +} + +class UserKlass + +// test 1: PTV is in consuming position (yield-case) +fun testYield() { + val buildee = build { + yield { val x: UserKlass = this@yield } + } + checkExactType Unit>>(>; Buildee>")!>buildee) +} + +// test 2: PTV is in producing position (materialize-case) +fun testMaterialize() { + fun shareTypeInfo(from: T, to: T) {} + val buildee = build { + shareTypeInfo( + { val x: UserKlass = this@shareTypeInfo }, + materialize() + ) + } + checkExactType Unit>>(>; Buildee>")!>buildee) +} diff --git a/compiler/testData/diagnostics/tests/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/FunctionWithReceiverToUnitImplicitLiteralsCase.kt b/compiler/testData/diagnostics/tests/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/FunctionWithReceiverToUnitImplicitLiteralsCase.kt new file mode 100644 index 00000000000..ca3f8c404c2 --- /dev/null +++ b/compiler/testData/diagnostics/tests/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/FunctionWithReceiverToUnitImplicitLiteralsCase.kt @@ -0,0 +1,46 @@ +// DIAGNOSTICS: -UNCHECKED_CAST + +// CHECK_TYPE_WITH_EXACT + +// ISSUE: KT-60720 +/* ATTENTION: + * this test is supposed to monitor unclear feature behavior; + * an explicit design decision regarding said behavior has not been made at the moment of test creation; + * if the behavior of the test changes, please consult with the linked YT ticket + * and either add a comment about the change if an explicit design decision is still unavailable + * (preferably accompanied by an analysis of the change's reasons) + * or remove this disclaimer otherwise + */ + +class Buildee { + fun yield(arg: CT) {} + fun materialize(): CT = fun UserKlass.() {} as CT +} + +fun build( + instructions: Buildee.() -> Unit +): Buildee { + return Buildee().apply(instructions) +} + +class UserKlass + +// test 1: PTV is in consuming position (yield-case) +fun testYield() { + val buildee = build { + yield { val x: UserKlass = this@yield } + } + checkExactType Unit>>( Unit>; Buildee<() -> Unit>"), TYPE_MISMATCH("Buildee<() -> Unit>; Buildee Unit>")!>buildee) +} + +// test 2: PTV is in producing position (materialize-case) +fun testMaterialize() { + fun shareTypeInfo(from: T, to: T) {} + val buildee = build { + shareTypeInfo( + { val x: UserKlass = this@shareTypeInfo }, + materialize() + ) + } + checkExactType Unit>>( Unit>; Buildee<() -> Unit>"), TYPE_MISMATCH("Buildee<() -> Unit>; Buildee Unit>")!>buildee) +} diff --git a/compiler/testData/diagnostics/tests/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NothingMaterializeCase.kt b/compiler/testData/diagnostics/tests/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NothingMaterializeCase.kt new file mode 100644 index 00000000000..7bcaed258d5 --- /dev/null +++ b/compiler/testData/diagnostics/tests/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NothingMaterializeCase.kt @@ -0,0 +1,32 @@ +// FIR_IDENTICAL +// DIAGNOSTICS: -UNCHECKED_CAST, -UNREACHABLE_CODE + +// CHECK_TYPE_WITH_EXACT + +// ISSUE: KT-60880 +/* ATTENTION: + * this test monitors an unfixed compiler bug; + * if the behavior of the test changes, please consult with the linked YT ticket + * to check whether the described problem has been fixed by your changes; + * if the issue isn't actually fixed but new behavior persists, + * please add a comment about the behavior change to the ticket + * (preferably accompanied by an analysis of the change's reasons) + */ + +class Buildee { + fun materialize(): CT = null as CT +} + +fun build( + instructions: Buildee.() -> Unit +): Buildee { + return Buildee().apply(instructions) +} + +fun testMaterialize() { + fun consume(arg: Nothing) {} + val buildee = build { + consume(materialize()) + } + checkExactType>(buildee) +} diff --git a/compiler/testData/diagnostics/tests/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullableNothingNullLiteralMaterializeCase.fir.kt b/compiler/testData/diagnostics/tests/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullableNothingNullLiteralMaterializeCase.fir.kt new file mode 100644 index 00000000000..df093193c1c --- /dev/null +++ b/compiler/testData/diagnostics/tests/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullableNothingNullLiteralMaterializeCase.fir.kt @@ -0,0 +1,31 @@ +// DIAGNOSTICS: -UNCHECKED_CAST, -UNREACHABLE_CODE + +// CHECK_TYPE_WITH_EXACT + +// ISSUE: KT-60877 +/* ATTENTION: + * this test monitors an unfixed compiler bug; + * if the behavior of the test changes, please consult with the linked YT ticket + * to check whether the described problem has been fixed by your changes; + * if the issue isn't actually fixed but new behavior persists, + * please add a comment about the behavior change to the ticket + * (preferably accompanied by an analysis of the change's reasons) + */ + +class Buildee { + fun materialize(): CT = null as CT +} + +fun build( + instructions: Buildee.() -> Unit +): Buildee { + return Buildee().apply(instructions) +} + +fun testMaterialize() { + fun shareTypeInfo(from: T, to: T) {} + val buildee = build { + shareTypeInfo(null, materialize()) + } + checkExactType>(; Buildee")!>buildee) +} diff --git a/compiler/testData/diagnostics/tests/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullableNothingNullLiteralMaterializeCase.kt b/compiler/testData/diagnostics/tests/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullableNothingNullLiteralMaterializeCase.kt new file mode 100644 index 00000000000..b23fb96aa48 --- /dev/null +++ b/compiler/testData/diagnostics/tests/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullableNothingNullLiteralMaterializeCase.kt @@ -0,0 +1,31 @@ +// DIAGNOSTICS: -UNCHECKED_CAST, -UNREACHABLE_CODE + +// CHECK_TYPE_WITH_EXACT + +// ISSUE: KT-60877 +/* ATTENTION: + * this test monitors an unfixed compiler bug; + * if the behavior of the test changes, please consult with the linked YT ticket + * to check whether the described problem has been fixed by your changes; + * if the issue isn't actually fixed but new behavior persists, + * please add a comment about the behavior change to the ticket + * (preferably accompanied by an analysis of the change's reasons) + */ + +class Buildee { + fun materialize(): CT = null as CT +} + +fun build( + instructions: Buildee.() -> Unit +): Buildee { + return Buildee().apply(instructions) +} + +fun testMaterialize() { + fun shareTypeInfo(from: T, to: T) {} + val buildee = build { + shareTypeInfo(null, materialize()) + } + checkExactType>(; Buildee"), TYPE_MISMATCH("Buildee; Buildee")!>buildee) +} diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java index c7da9248641..e95b1395e5d 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java @@ -3430,6 +3430,40 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest { runTest("compiler/testData/diagnostics/tests/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/sourceSinkFeedContexts/ThroughDelegatedLocalVariableMaterializeCase.kt"); } } + + @Nested + @TestMetadata("compiler/testData/diagnostics/tests/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes") + @TestDataPath("$PROJECT_ROOT") + public class TargetTypes { + @Test + public void testAllFilesPresentInTargetTypes() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes"), Pattern.compile("^(.*)\\.kts?$"), Pattern.compile("^(.+)\\.(reversed|fir|ll)\\.kts?$"), true); + } + + @Test + @TestMetadata("FunctionWithParameterToUnitImplicitLiteralsCase.kt") + public void testFunctionWithParameterToUnitImplicitLiteralsCase() throws Exception { + runTest("compiler/testData/diagnostics/tests/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/FunctionWithParameterToUnitImplicitLiteralsCase.kt"); + } + + @Test + @TestMetadata("FunctionWithReceiverToUnitImplicitLiteralsCase.kt") + public void testFunctionWithReceiverToUnitImplicitLiteralsCase() throws Exception { + runTest("compiler/testData/diagnostics/tests/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/FunctionWithReceiverToUnitImplicitLiteralsCase.kt"); + } + + @Test + @TestMetadata("NothingMaterializeCase.kt") + public void testNothingMaterializeCase() throws Exception { + runTest("compiler/testData/diagnostics/tests/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NothingMaterializeCase.kt"); + } + + @Test + @TestMetadata("NullableNothingNullLiteralMaterializeCase.kt") + public void testNullableNothingNullLiteralMaterializeCase() throws Exception { + runTest("compiler/testData/diagnostics/tests/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullableNothingNullLiteralMaterializeCase.kt"); + } + } } } } 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 a4ecaa7f747..1760b0c15fe 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 @@ -2659,6 +2659,232 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/sourceSinkFeedContexts/ThroughLocalVariable.kt"); } } + + @Nested + @TestMetadata("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes") + @TestDataPath("$PROJECT_ROOT") + public class TargetTypes { + @Test + public void testAllFilesPresentInTargetTypes() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); + } + + @Test + @TestMetadata("AnonymousObject.kt") + public void testAnonymousObject() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/AnonymousObject.kt"); + } + + @Test + @TestMetadata("DefinitelyNonNullableTypeParameter.kt") + public void testDefinitelyNonNullableTypeParameter() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/DefinitelyNonNullableTypeParameter.kt"); + } + + @Test + @TestMetadata("EnclosingClass.kt") + public void testEnclosingClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingClass.kt"); + } + + @Test + @TestMetadata("EnclosingEnumerationEntryType.kt") + public void testEnclosingEnumerationEntryType() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingEnumerationEntryType.kt"); + } + + @Test + @TestMetadata("EnclosingEnumerationType.kt") + public void testEnclosingEnumerationType() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingEnumerationType.kt"); + } + + @Test + @TestMetadata("EnclosingExplicitlyGenericInnerClass.kt") + public void testEnclosingExplicitlyGenericInnerClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingExplicitlyGenericInnerClass.kt"); + } + + @Test + @TestMetadata("EnclosingGenericClass.kt") + public void testEnclosingGenericClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingGenericClass.kt"); + } + + @Test + @TestMetadata("EnclosingImplicitlyGenericInnerClass.kt") + public void testEnclosingImplicitlyGenericInnerClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingImplicitlyGenericInnerClass.kt"); + } + + @Test + @TestMetadata("EnclosingInnerClass.kt") + public void testEnclosingInnerClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingInnerClass.kt"); + } + + @Test + @TestMetadata("EnumerationType.kt") + public void testEnumerationType() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnumerationType.kt"); + } + + @Test + @TestMetadata("ExplicitlyGenericInnerClass.kt") + public void testExplicitlyGenericInnerClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/ExplicitlyGenericInnerClass.kt"); + } + + @Test + @TestMetadata("FunctionWithParameterToUnit.kt") + public void testFunctionWithParameterToUnit() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/FunctionWithParameterToUnit.kt"); + } + + @Test + @TestMetadata("FunctionWithReceiverToUnit.kt") + public void testFunctionWithReceiverToUnit() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/FunctionWithReceiverToUnit.kt"); + } + + @Test + @TestMetadata("GenericLocalClass.kt") + public void testGenericLocalClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericLocalClass.kt"); + } + + @Test + @TestMetadata("GenericLocalClassWithLeakingTypeParameter.kt") + public void testGenericLocalClassWithLeakingTypeParameter() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericLocalClassWithLeakingTypeParameter.kt"); + } + + @Test + @TestMetadata("GenericWithContravariantTypeParameter.kt") + public void testGenericWithContravariantTypeParameter() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithContravariantTypeParameter.kt"); + } + + @Test + @TestMetadata("GenericWithCovariantTypeParameter.kt") + public void testGenericWithCovariantTypeParameter() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithCovariantTypeParameter.kt"); + } + + @Test + @TestMetadata("GenericWithInProjectedTypeArgument.kt") + public void testGenericWithInProjectedTypeArgument() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithInProjectedTypeArgument.kt"); + } + + @Test + @TestMetadata("GenericWithInvariantTypeParameter.kt") + public void testGenericWithInvariantTypeParameter() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithInvariantTypeParameter.kt"); + } + + @Test + @TestMetadata("GenericWithOutProjectedTypeArgument.kt") + public void testGenericWithOutProjectedTypeArgument() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithOutProjectedTypeArgument.kt"); + } + + @Test + @TestMetadata("GenericWithStarProjectedTypeArgument.kt") + public void testGenericWithStarProjectedTypeArgument() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithStarProjectedTypeArgument.kt"); + } + + @Test + @TestMetadata("ImplicitlyGenericInnerClass.kt") + public void testImplicitlyGenericInnerClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/ImplicitlyGenericInnerClass.kt"); + } + + @Test + @TestMetadata("InnerClass.kt") + public void testInnerClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/InnerClass.kt"); + } + + @Test + @TestMetadata("Int.kt") + public void testInt() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/Int.kt"); + } + + @Test + @TestMetadata("IntersectionType.kt") + public void testIntersectionType() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/IntersectionType.kt"); + } + + @Test + @TestMetadata("LocalClass.kt") + public void testLocalClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/LocalClass.kt"); + } + + @Test + @TestMetadata("NothingYieldCase.kt") + public void testNothingYieldCase() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NothingYieldCase.kt"); + } + + @Test + @TestMetadata("NullableNothing.kt") + public void testNullableNothing() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullableNothing.kt"); + } + + @Test + @TestMetadata("NullableNothingNullLiteralYieldCase.kt") + public void testNullableNothingNullLiteralYieldCase() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullableNothingNullLiteralYieldCase.kt"); + } + + @Test + @TestMetadata("NullableType.kt") + public void testNullableType() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullableType.kt"); + } + + @Test + @TestMetadata("NullableTypeParameter.kt") + public void testNullableTypeParameter() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullableTypeParameter.kt"); + } + + @Test + @TestMetadata("NullaryFunctionToUnit.kt") + public void testNullaryFunctionToUnit() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullaryFunctionToUnit.kt"); + } + + @Test + @TestMetadata("NullaryFunctionWithReturnValue.kt") + public void testNullaryFunctionWithReturnValue() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullaryFunctionWithReturnValue.kt"); + } + + @Test + @TestMetadata("String.kt") + public void testString() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/String.kt"); + } + + @Test + @TestMetadata("SuspendingFunction.kt") + public void testSuspendingFunction() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/SuspendingFunction.kt"); + } + + @Test + @TestMetadata("TypeParameter.kt") + public void testTypeParameter() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/TypeParameter.kt"); + } + } } } } 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 c1e3bf2d249..ab385a6d547 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 @@ -2833,6 +2833,232 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/sourceSinkFeedContexts/ThroughLocalVariable.kt"); } } + + @Nested + @TestMetadata("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes") + @TestDataPath("$PROJECT_ROOT") + public class TargetTypes { + @Test + public void testAllFilesPresentInTargetTypes() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @Test + @TestMetadata("AnonymousObject.kt") + public void testAnonymousObject() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/AnonymousObject.kt"); + } + + @Test + @TestMetadata("DefinitelyNonNullableTypeParameter.kt") + public void testDefinitelyNonNullableTypeParameter() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/DefinitelyNonNullableTypeParameter.kt"); + } + + @Test + @TestMetadata("EnclosingClass.kt") + public void testEnclosingClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingClass.kt"); + } + + @Test + @TestMetadata("EnclosingEnumerationEntryType.kt") + public void testEnclosingEnumerationEntryType() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingEnumerationEntryType.kt"); + } + + @Test + @TestMetadata("EnclosingEnumerationType.kt") + public void testEnclosingEnumerationType() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingEnumerationType.kt"); + } + + @Test + @TestMetadata("EnclosingExplicitlyGenericInnerClass.kt") + public void testEnclosingExplicitlyGenericInnerClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingExplicitlyGenericInnerClass.kt"); + } + + @Test + @TestMetadata("EnclosingGenericClass.kt") + public void testEnclosingGenericClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingGenericClass.kt"); + } + + @Test + @TestMetadata("EnclosingImplicitlyGenericInnerClass.kt") + public void testEnclosingImplicitlyGenericInnerClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingImplicitlyGenericInnerClass.kt"); + } + + @Test + @TestMetadata("EnclosingInnerClass.kt") + public void testEnclosingInnerClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingInnerClass.kt"); + } + + @Test + @TestMetadata("EnumerationType.kt") + public void testEnumerationType() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnumerationType.kt"); + } + + @Test + @TestMetadata("ExplicitlyGenericInnerClass.kt") + public void testExplicitlyGenericInnerClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/ExplicitlyGenericInnerClass.kt"); + } + + @Test + @TestMetadata("FunctionWithParameterToUnit.kt") + public void testFunctionWithParameterToUnit() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/FunctionWithParameterToUnit.kt"); + } + + @Test + @TestMetadata("FunctionWithReceiverToUnit.kt") + public void testFunctionWithReceiverToUnit() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/FunctionWithReceiverToUnit.kt"); + } + + @Test + @TestMetadata("GenericLocalClass.kt") + public void testGenericLocalClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericLocalClass.kt"); + } + + @Test + @TestMetadata("GenericLocalClassWithLeakingTypeParameter.kt") + public void testGenericLocalClassWithLeakingTypeParameter() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericLocalClassWithLeakingTypeParameter.kt"); + } + + @Test + @TestMetadata("GenericWithContravariantTypeParameter.kt") + public void testGenericWithContravariantTypeParameter() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithContravariantTypeParameter.kt"); + } + + @Test + @TestMetadata("GenericWithCovariantTypeParameter.kt") + public void testGenericWithCovariantTypeParameter() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithCovariantTypeParameter.kt"); + } + + @Test + @TestMetadata("GenericWithInProjectedTypeArgument.kt") + public void testGenericWithInProjectedTypeArgument() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithInProjectedTypeArgument.kt"); + } + + @Test + @TestMetadata("GenericWithInvariantTypeParameter.kt") + public void testGenericWithInvariantTypeParameter() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithInvariantTypeParameter.kt"); + } + + @Test + @TestMetadata("GenericWithOutProjectedTypeArgument.kt") + public void testGenericWithOutProjectedTypeArgument() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithOutProjectedTypeArgument.kt"); + } + + @Test + @TestMetadata("GenericWithStarProjectedTypeArgument.kt") + public void testGenericWithStarProjectedTypeArgument() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithStarProjectedTypeArgument.kt"); + } + + @Test + @TestMetadata("ImplicitlyGenericInnerClass.kt") + public void testImplicitlyGenericInnerClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/ImplicitlyGenericInnerClass.kt"); + } + + @Test + @TestMetadata("InnerClass.kt") + public void testInnerClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/InnerClass.kt"); + } + + @Test + @TestMetadata("Int.kt") + public void testInt() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/Int.kt"); + } + + @Test + @TestMetadata("IntersectionType.kt") + public void testIntersectionType() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/IntersectionType.kt"); + } + + @Test + @TestMetadata("LocalClass.kt") + public void testLocalClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/LocalClass.kt"); + } + + @Test + @TestMetadata("NothingYieldCase.kt") + public void testNothingYieldCase() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NothingYieldCase.kt"); + } + + @Test + @TestMetadata("NullableNothing.kt") + public void testNullableNothing() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullableNothing.kt"); + } + + @Test + @TestMetadata("NullableNothingNullLiteralYieldCase.kt") + public void testNullableNothingNullLiteralYieldCase() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullableNothingNullLiteralYieldCase.kt"); + } + + @Test + @TestMetadata("NullableType.kt") + public void testNullableType() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullableType.kt"); + } + + @Test + @TestMetadata("NullableTypeParameter.kt") + public void testNullableTypeParameter() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullableTypeParameter.kt"); + } + + @Test + @TestMetadata("NullaryFunctionToUnit.kt") + public void testNullaryFunctionToUnit() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullaryFunctionToUnit.kt"); + } + + @Test + @TestMetadata("NullaryFunctionWithReturnValue.kt") + public void testNullaryFunctionWithReturnValue() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullaryFunctionWithReturnValue.kt"); + } + + @Test + @TestMetadata("String.kt") + public void testString() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/String.kt"); + } + + @Test + @TestMetadata("SuspendingFunction.kt") + public void testSuspendingFunction() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/SuspendingFunction.kt"); + } + + @Test + @TestMetadata("TypeParameter.kt") + public void testTypeParameter() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/TypeParameter.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 f8ff3e3c3b5..a2649496223 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 @@ -2833,6 +2833,232 @@ public class IrBlackBoxCodegenWithIrInlinerTestGenerated extends AbstractIrBlack runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/sourceSinkFeedContexts/ThroughLocalVariable.kt"); } } + + @Nested + @TestMetadata("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes") + @TestDataPath("$PROJECT_ROOT") + public class TargetTypes { + @Test + public void testAllFilesPresentInTargetTypes() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @Test + @TestMetadata("AnonymousObject.kt") + public void testAnonymousObject() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/AnonymousObject.kt"); + } + + @Test + @TestMetadata("DefinitelyNonNullableTypeParameter.kt") + public void testDefinitelyNonNullableTypeParameter() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/DefinitelyNonNullableTypeParameter.kt"); + } + + @Test + @TestMetadata("EnclosingClass.kt") + public void testEnclosingClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingClass.kt"); + } + + @Test + @TestMetadata("EnclosingEnumerationEntryType.kt") + public void testEnclosingEnumerationEntryType() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingEnumerationEntryType.kt"); + } + + @Test + @TestMetadata("EnclosingEnumerationType.kt") + public void testEnclosingEnumerationType() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingEnumerationType.kt"); + } + + @Test + @TestMetadata("EnclosingExplicitlyGenericInnerClass.kt") + public void testEnclosingExplicitlyGenericInnerClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingExplicitlyGenericInnerClass.kt"); + } + + @Test + @TestMetadata("EnclosingGenericClass.kt") + public void testEnclosingGenericClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingGenericClass.kt"); + } + + @Test + @TestMetadata("EnclosingImplicitlyGenericInnerClass.kt") + public void testEnclosingImplicitlyGenericInnerClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingImplicitlyGenericInnerClass.kt"); + } + + @Test + @TestMetadata("EnclosingInnerClass.kt") + public void testEnclosingInnerClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingInnerClass.kt"); + } + + @Test + @TestMetadata("EnumerationType.kt") + public void testEnumerationType() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnumerationType.kt"); + } + + @Test + @TestMetadata("ExplicitlyGenericInnerClass.kt") + public void testExplicitlyGenericInnerClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/ExplicitlyGenericInnerClass.kt"); + } + + @Test + @TestMetadata("FunctionWithParameterToUnit.kt") + public void testFunctionWithParameterToUnit() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/FunctionWithParameterToUnit.kt"); + } + + @Test + @TestMetadata("FunctionWithReceiverToUnit.kt") + public void testFunctionWithReceiverToUnit() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/FunctionWithReceiverToUnit.kt"); + } + + @Test + @TestMetadata("GenericLocalClass.kt") + public void testGenericLocalClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericLocalClass.kt"); + } + + @Test + @TestMetadata("GenericLocalClassWithLeakingTypeParameter.kt") + public void testGenericLocalClassWithLeakingTypeParameter() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericLocalClassWithLeakingTypeParameter.kt"); + } + + @Test + @TestMetadata("GenericWithContravariantTypeParameter.kt") + public void testGenericWithContravariantTypeParameter() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithContravariantTypeParameter.kt"); + } + + @Test + @TestMetadata("GenericWithCovariantTypeParameter.kt") + public void testGenericWithCovariantTypeParameter() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithCovariantTypeParameter.kt"); + } + + @Test + @TestMetadata("GenericWithInProjectedTypeArgument.kt") + public void testGenericWithInProjectedTypeArgument() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithInProjectedTypeArgument.kt"); + } + + @Test + @TestMetadata("GenericWithInvariantTypeParameter.kt") + public void testGenericWithInvariantTypeParameter() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithInvariantTypeParameter.kt"); + } + + @Test + @TestMetadata("GenericWithOutProjectedTypeArgument.kt") + public void testGenericWithOutProjectedTypeArgument() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithOutProjectedTypeArgument.kt"); + } + + @Test + @TestMetadata("GenericWithStarProjectedTypeArgument.kt") + public void testGenericWithStarProjectedTypeArgument() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithStarProjectedTypeArgument.kt"); + } + + @Test + @TestMetadata("ImplicitlyGenericInnerClass.kt") + public void testImplicitlyGenericInnerClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/ImplicitlyGenericInnerClass.kt"); + } + + @Test + @TestMetadata("InnerClass.kt") + public void testInnerClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/InnerClass.kt"); + } + + @Test + @TestMetadata("Int.kt") + public void testInt() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/Int.kt"); + } + + @Test + @TestMetadata("IntersectionType.kt") + public void testIntersectionType() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/IntersectionType.kt"); + } + + @Test + @TestMetadata("LocalClass.kt") + public void testLocalClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/LocalClass.kt"); + } + + @Test + @TestMetadata("NothingYieldCase.kt") + public void testNothingYieldCase() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NothingYieldCase.kt"); + } + + @Test + @TestMetadata("NullableNothing.kt") + public void testNullableNothing() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullableNothing.kt"); + } + + @Test + @TestMetadata("NullableNothingNullLiteralYieldCase.kt") + public void testNullableNothingNullLiteralYieldCase() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullableNothingNullLiteralYieldCase.kt"); + } + + @Test + @TestMetadata("NullableType.kt") + public void testNullableType() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullableType.kt"); + } + + @Test + @TestMetadata("NullableTypeParameter.kt") + public void testNullableTypeParameter() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullableTypeParameter.kt"); + } + + @Test + @TestMetadata("NullaryFunctionToUnit.kt") + public void testNullaryFunctionToUnit() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullaryFunctionToUnit.kt"); + } + + @Test + @TestMetadata("NullaryFunctionWithReturnValue.kt") + public void testNullaryFunctionWithReturnValue() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullaryFunctionWithReturnValue.kt"); + } + + @Test + @TestMetadata("String.kt") + public void testString() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/String.kt"); + } + + @Test + @TestMetadata("SuspendingFunction.kt") + public void testSuspendingFunction() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/SuspendingFunction.kt"); + } + + @Test + @TestMetadata("TypeParameter.kt") + public void testTypeParameter() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/TypeParameter.kt"); + } + } } } } diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java index f3f83432008..b92afb28c0c 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java @@ -2486,6 +2486,199 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/sourceSinkFeedContexts/ThroughLocalVariable.kt"); } } + + @TestMetadata("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class TargetTypes extends AbstractLightAnalysisModeTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInTargetTypes() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("AnonymousObject.kt") + public void testAnonymousObject() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/AnonymousObject.kt"); + } + + @TestMetadata("DefinitelyNonNullableTypeParameter.kt") + public void testDefinitelyNonNullableTypeParameter() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/DefinitelyNonNullableTypeParameter.kt"); + } + + @TestMetadata("EnclosingClass.kt") + public void testEnclosingClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingClass.kt"); + } + + @TestMetadata("EnclosingEnumerationEntryType.kt") + public void testEnclosingEnumerationEntryType() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingEnumerationEntryType.kt"); + } + + @TestMetadata("EnclosingEnumerationType.kt") + public void testEnclosingEnumerationType() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingEnumerationType.kt"); + } + + @TestMetadata("EnclosingExplicitlyGenericInnerClass.kt") + public void testEnclosingExplicitlyGenericInnerClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingExplicitlyGenericInnerClass.kt"); + } + + @TestMetadata("EnclosingGenericClass.kt") + public void testEnclosingGenericClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingGenericClass.kt"); + } + + @TestMetadata("EnclosingImplicitlyGenericInnerClass.kt") + public void testEnclosingImplicitlyGenericInnerClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingImplicitlyGenericInnerClass.kt"); + } + + @TestMetadata("EnclosingInnerClass.kt") + public void testEnclosingInnerClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingInnerClass.kt"); + } + + @TestMetadata("EnumerationType.kt") + public void testEnumerationType() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnumerationType.kt"); + } + + @TestMetadata("ExplicitlyGenericInnerClass.kt") + public void testExplicitlyGenericInnerClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/ExplicitlyGenericInnerClass.kt"); + } + + @TestMetadata("FunctionWithParameterToUnit.kt") + public void testFunctionWithParameterToUnit() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/FunctionWithParameterToUnit.kt"); + } + + @TestMetadata("FunctionWithReceiverToUnit.kt") + public void testFunctionWithReceiverToUnit() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/FunctionWithReceiverToUnit.kt"); + } + + @TestMetadata("GenericLocalClass.kt") + public void testGenericLocalClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericLocalClass.kt"); + } + + @TestMetadata("GenericLocalClassWithLeakingTypeParameter.kt") + public void testGenericLocalClassWithLeakingTypeParameter() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericLocalClassWithLeakingTypeParameter.kt"); + } + + @TestMetadata("GenericWithContravariantTypeParameter.kt") + public void testGenericWithContravariantTypeParameter() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithContravariantTypeParameter.kt"); + } + + @TestMetadata("GenericWithCovariantTypeParameter.kt") + public void testGenericWithCovariantTypeParameter() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithCovariantTypeParameter.kt"); + } + + @TestMetadata("GenericWithInProjectedTypeArgument.kt") + public void testGenericWithInProjectedTypeArgument() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithInProjectedTypeArgument.kt"); + } + + @TestMetadata("GenericWithInvariantTypeParameter.kt") + public void testGenericWithInvariantTypeParameter() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithInvariantTypeParameter.kt"); + } + + @TestMetadata("GenericWithOutProjectedTypeArgument.kt") + public void testGenericWithOutProjectedTypeArgument() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithOutProjectedTypeArgument.kt"); + } + + @TestMetadata("GenericWithStarProjectedTypeArgument.kt") + public void testGenericWithStarProjectedTypeArgument() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithStarProjectedTypeArgument.kt"); + } + + @TestMetadata("ImplicitlyGenericInnerClass.kt") + public void testImplicitlyGenericInnerClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/ImplicitlyGenericInnerClass.kt"); + } + + @TestMetadata("InnerClass.kt") + public void testInnerClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/InnerClass.kt"); + } + + @TestMetadata("Int.kt") + public void testInt() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/Int.kt"); + } + + @TestMetadata("IntersectionType.kt") + public void testIntersectionType() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/IntersectionType.kt"); + } + + @TestMetadata("LocalClass.kt") + public void testLocalClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/LocalClass.kt"); + } + + @TestMetadata("NothingYieldCase.kt") + public void testNothingYieldCase() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NothingYieldCase.kt"); + } + + @TestMetadata("NullableNothing.kt") + public void testNullableNothing() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullableNothing.kt"); + } + + @TestMetadata("NullableNothingNullLiteralYieldCase.kt") + public void testNullableNothingNullLiteralYieldCase() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullableNothingNullLiteralYieldCase.kt"); + } + + @TestMetadata("NullableType.kt") + public void testNullableType() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullableType.kt"); + } + + @TestMetadata("NullableTypeParameter.kt") + public void testNullableTypeParameter() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullableTypeParameter.kt"); + } + + @TestMetadata("NullaryFunctionToUnit.kt") + public void testNullaryFunctionToUnit() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullaryFunctionToUnit.kt"); + } + + @TestMetadata("NullaryFunctionWithReturnValue.kt") + public void testNullaryFunctionWithReturnValue() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullaryFunctionWithReturnValue.kt"); + } + + @TestMetadata("String.kt") + public void testString() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/String.kt"); + } + + @TestMetadata("SuspendingFunction.kt") + public void testSuspendingFunction() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/SuspendingFunction.kt"); + } + + @TestMetadata("TypeParameter.kt") + public void testTypeParameter() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/TypeParameter.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 2a9a4a065c2..1eb344afebe 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 @@ -1945,6 +1945,232 @@ public class FirJsCodegenBoxTestGenerated extends AbstractFirJsCodegenBoxTest { runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/sourceSinkFeedContexts/ThroughLocalVariable.kt"); } } + + @Nested + @TestMetadata("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes") + @TestDataPath("$PROJECT_ROOT") + public class TargetTypes { + @Test + public void testAllFilesPresentInTargetTypes() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR, true); + } + + @Test + @TestMetadata("AnonymousObject.kt") + public void testAnonymousObject() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/AnonymousObject.kt"); + } + + @Test + @TestMetadata("DefinitelyNonNullableTypeParameter.kt") + public void testDefinitelyNonNullableTypeParameter() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/DefinitelyNonNullableTypeParameter.kt"); + } + + @Test + @TestMetadata("EnclosingClass.kt") + public void testEnclosingClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingClass.kt"); + } + + @Test + @TestMetadata("EnclosingEnumerationEntryType.kt") + public void testEnclosingEnumerationEntryType() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingEnumerationEntryType.kt"); + } + + @Test + @TestMetadata("EnclosingEnumerationType.kt") + public void testEnclosingEnumerationType() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingEnumerationType.kt"); + } + + @Test + @TestMetadata("EnclosingExplicitlyGenericInnerClass.kt") + public void testEnclosingExplicitlyGenericInnerClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingExplicitlyGenericInnerClass.kt"); + } + + @Test + @TestMetadata("EnclosingGenericClass.kt") + public void testEnclosingGenericClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingGenericClass.kt"); + } + + @Test + @TestMetadata("EnclosingImplicitlyGenericInnerClass.kt") + public void testEnclosingImplicitlyGenericInnerClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingImplicitlyGenericInnerClass.kt"); + } + + @Test + @TestMetadata("EnclosingInnerClass.kt") + public void testEnclosingInnerClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingInnerClass.kt"); + } + + @Test + @TestMetadata("EnumerationType.kt") + public void testEnumerationType() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnumerationType.kt"); + } + + @Test + @TestMetadata("ExplicitlyGenericInnerClass.kt") + public void testExplicitlyGenericInnerClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/ExplicitlyGenericInnerClass.kt"); + } + + @Test + @TestMetadata("FunctionWithParameterToUnit.kt") + public void testFunctionWithParameterToUnit() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/FunctionWithParameterToUnit.kt"); + } + + @Test + @TestMetadata("FunctionWithReceiverToUnit.kt") + public void testFunctionWithReceiverToUnit() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/FunctionWithReceiverToUnit.kt"); + } + + @Test + @TestMetadata("GenericLocalClass.kt") + public void testGenericLocalClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericLocalClass.kt"); + } + + @Test + @TestMetadata("GenericLocalClassWithLeakingTypeParameter.kt") + public void testGenericLocalClassWithLeakingTypeParameter() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericLocalClassWithLeakingTypeParameter.kt"); + } + + @Test + @TestMetadata("GenericWithContravariantTypeParameter.kt") + public void testGenericWithContravariantTypeParameter() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithContravariantTypeParameter.kt"); + } + + @Test + @TestMetadata("GenericWithCovariantTypeParameter.kt") + public void testGenericWithCovariantTypeParameter() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithCovariantTypeParameter.kt"); + } + + @Test + @TestMetadata("GenericWithInProjectedTypeArgument.kt") + public void testGenericWithInProjectedTypeArgument() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithInProjectedTypeArgument.kt"); + } + + @Test + @TestMetadata("GenericWithInvariantTypeParameter.kt") + public void testGenericWithInvariantTypeParameter() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithInvariantTypeParameter.kt"); + } + + @Test + @TestMetadata("GenericWithOutProjectedTypeArgument.kt") + public void testGenericWithOutProjectedTypeArgument() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithOutProjectedTypeArgument.kt"); + } + + @Test + @TestMetadata("GenericWithStarProjectedTypeArgument.kt") + public void testGenericWithStarProjectedTypeArgument() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithStarProjectedTypeArgument.kt"); + } + + @Test + @TestMetadata("ImplicitlyGenericInnerClass.kt") + public void testImplicitlyGenericInnerClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/ImplicitlyGenericInnerClass.kt"); + } + + @Test + @TestMetadata("InnerClass.kt") + public void testInnerClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/InnerClass.kt"); + } + + @Test + @TestMetadata("Int.kt") + public void testInt() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/Int.kt"); + } + + @Test + @TestMetadata("IntersectionType.kt") + public void testIntersectionType() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/IntersectionType.kt"); + } + + @Test + @TestMetadata("LocalClass.kt") + public void testLocalClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/LocalClass.kt"); + } + + @Test + @TestMetadata("NothingYieldCase.kt") + public void testNothingYieldCase() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NothingYieldCase.kt"); + } + + @Test + @TestMetadata("NullableNothing.kt") + public void testNullableNothing() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullableNothing.kt"); + } + + @Test + @TestMetadata("NullableNothingNullLiteralYieldCase.kt") + public void testNullableNothingNullLiteralYieldCase() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullableNothingNullLiteralYieldCase.kt"); + } + + @Test + @TestMetadata("NullableType.kt") + public void testNullableType() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullableType.kt"); + } + + @Test + @TestMetadata("NullableTypeParameter.kt") + public void testNullableTypeParameter() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullableTypeParameter.kt"); + } + + @Test + @TestMetadata("NullaryFunctionToUnit.kt") + public void testNullaryFunctionToUnit() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullaryFunctionToUnit.kt"); + } + + @Test + @TestMetadata("NullaryFunctionWithReturnValue.kt") + public void testNullaryFunctionWithReturnValue() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullaryFunctionWithReturnValue.kt"); + } + + @Test + @TestMetadata("String.kt") + public void testString() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/String.kt"); + } + + @Test + @TestMetadata("SuspendingFunction.kt") + public void testSuspendingFunction() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/SuspendingFunction.kt"); + } + + @Test + @TestMetadata("TypeParameter.kt") + public void testTypeParameter() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/TypeParameter.kt"); + } + } } } } diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirJsES6CodegenBoxTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirJsES6CodegenBoxTestGenerated.java index b65ed588ac1..8f44f9fa348 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirJsES6CodegenBoxTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirJsES6CodegenBoxTestGenerated.java @@ -1945,6 +1945,232 @@ public class FirJsES6CodegenBoxTestGenerated extends AbstractFirJsES6CodegenBoxT runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/sourceSinkFeedContexts/ThroughLocalVariable.kt"); } } + + @Nested + @TestMetadata("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes") + @TestDataPath("$PROJECT_ROOT") + public class TargetTypes { + @Test + public void testAllFilesPresentInTargetTypes() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true); + } + + @Test + @TestMetadata("AnonymousObject.kt") + public void testAnonymousObject() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/AnonymousObject.kt"); + } + + @Test + @TestMetadata("DefinitelyNonNullableTypeParameter.kt") + public void testDefinitelyNonNullableTypeParameter() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/DefinitelyNonNullableTypeParameter.kt"); + } + + @Test + @TestMetadata("EnclosingClass.kt") + public void testEnclosingClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingClass.kt"); + } + + @Test + @TestMetadata("EnclosingEnumerationEntryType.kt") + public void testEnclosingEnumerationEntryType() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingEnumerationEntryType.kt"); + } + + @Test + @TestMetadata("EnclosingEnumerationType.kt") + public void testEnclosingEnumerationType() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingEnumerationType.kt"); + } + + @Test + @TestMetadata("EnclosingExplicitlyGenericInnerClass.kt") + public void testEnclosingExplicitlyGenericInnerClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingExplicitlyGenericInnerClass.kt"); + } + + @Test + @TestMetadata("EnclosingGenericClass.kt") + public void testEnclosingGenericClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingGenericClass.kt"); + } + + @Test + @TestMetadata("EnclosingImplicitlyGenericInnerClass.kt") + public void testEnclosingImplicitlyGenericInnerClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingImplicitlyGenericInnerClass.kt"); + } + + @Test + @TestMetadata("EnclosingInnerClass.kt") + public void testEnclosingInnerClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingInnerClass.kt"); + } + + @Test + @TestMetadata("EnumerationType.kt") + public void testEnumerationType() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnumerationType.kt"); + } + + @Test + @TestMetadata("ExplicitlyGenericInnerClass.kt") + public void testExplicitlyGenericInnerClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/ExplicitlyGenericInnerClass.kt"); + } + + @Test + @TestMetadata("FunctionWithParameterToUnit.kt") + public void testFunctionWithParameterToUnit() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/FunctionWithParameterToUnit.kt"); + } + + @Test + @TestMetadata("FunctionWithReceiverToUnit.kt") + public void testFunctionWithReceiverToUnit() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/FunctionWithReceiverToUnit.kt"); + } + + @Test + @TestMetadata("GenericLocalClass.kt") + public void testGenericLocalClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericLocalClass.kt"); + } + + @Test + @TestMetadata("GenericLocalClassWithLeakingTypeParameter.kt") + public void testGenericLocalClassWithLeakingTypeParameter() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericLocalClassWithLeakingTypeParameter.kt"); + } + + @Test + @TestMetadata("GenericWithContravariantTypeParameter.kt") + public void testGenericWithContravariantTypeParameter() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithContravariantTypeParameter.kt"); + } + + @Test + @TestMetadata("GenericWithCovariantTypeParameter.kt") + public void testGenericWithCovariantTypeParameter() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithCovariantTypeParameter.kt"); + } + + @Test + @TestMetadata("GenericWithInProjectedTypeArgument.kt") + public void testGenericWithInProjectedTypeArgument() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithInProjectedTypeArgument.kt"); + } + + @Test + @TestMetadata("GenericWithInvariantTypeParameter.kt") + public void testGenericWithInvariantTypeParameter() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithInvariantTypeParameter.kt"); + } + + @Test + @TestMetadata("GenericWithOutProjectedTypeArgument.kt") + public void testGenericWithOutProjectedTypeArgument() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithOutProjectedTypeArgument.kt"); + } + + @Test + @TestMetadata("GenericWithStarProjectedTypeArgument.kt") + public void testGenericWithStarProjectedTypeArgument() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithStarProjectedTypeArgument.kt"); + } + + @Test + @TestMetadata("ImplicitlyGenericInnerClass.kt") + public void testImplicitlyGenericInnerClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/ImplicitlyGenericInnerClass.kt"); + } + + @Test + @TestMetadata("InnerClass.kt") + public void testInnerClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/InnerClass.kt"); + } + + @Test + @TestMetadata("Int.kt") + public void testInt() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/Int.kt"); + } + + @Test + @TestMetadata("IntersectionType.kt") + public void testIntersectionType() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/IntersectionType.kt"); + } + + @Test + @TestMetadata("LocalClass.kt") + public void testLocalClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/LocalClass.kt"); + } + + @Test + @TestMetadata("NothingYieldCase.kt") + public void testNothingYieldCase() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NothingYieldCase.kt"); + } + + @Test + @TestMetadata("NullableNothing.kt") + public void testNullableNothing() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullableNothing.kt"); + } + + @Test + @TestMetadata("NullableNothingNullLiteralYieldCase.kt") + public void testNullableNothingNullLiteralYieldCase() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullableNothingNullLiteralYieldCase.kt"); + } + + @Test + @TestMetadata("NullableType.kt") + public void testNullableType() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullableType.kt"); + } + + @Test + @TestMetadata("NullableTypeParameter.kt") + public void testNullableTypeParameter() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullableTypeParameter.kt"); + } + + @Test + @TestMetadata("NullaryFunctionToUnit.kt") + public void testNullaryFunctionToUnit() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullaryFunctionToUnit.kt"); + } + + @Test + @TestMetadata("NullaryFunctionWithReturnValue.kt") + public void testNullaryFunctionWithReturnValue() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullaryFunctionWithReturnValue.kt"); + } + + @Test + @TestMetadata("String.kt") + public void testString() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/String.kt"); + } + + @Test + @TestMetadata("SuspendingFunction.kt") + public void testSuspendingFunction() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/SuspendingFunction.kt"); + } + + @Test + @TestMetadata("TypeParameter.kt") + public void testTypeParameter() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/TypeParameter.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 445e2c314df..b05302c810d 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 @@ -1945,6 +1945,232 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/sourceSinkFeedContexts/ThroughLocalVariable.kt"); } } + + @Nested + @TestMetadata("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes") + @TestDataPath("$PROJECT_ROOT") + public class TargetTypes { + @Test + public void testAllFilesPresentInTargetTypes() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR, true); + } + + @Test + @TestMetadata("AnonymousObject.kt") + public void testAnonymousObject() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/AnonymousObject.kt"); + } + + @Test + @TestMetadata("DefinitelyNonNullableTypeParameter.kt") + public void testDefinitelyNonNullableTypeParameter() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/DefinitelyNonNullableTypeParameter.kt"); + } + + @Test + @TestMetadata("EnclosingClass.kt") + public void testEnclosingClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingClass.kt"); + } + + @Test + @TestMetadata("EnclosingEnumerationEntryType.kt") + public void testEnclosingEnumerationEntryType() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingEnumerationEntryType.kt"); + } + + @Test + @TestMetadata("EnclosingEnumerationType.kt") + public void testEnclosingEnumerationType() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingEnumerationType.kt"); + } + + @Test + @TestMetadata("EnclosingExplicitlyGenericInnerClass.kt") + public void testEnclosingExplicitlyGenericInnerClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingExplicitlyGenericInnerClass.kt"); + } + + @Test + @TestMetadata("EnclosingGenericClass.kt") + public void testEnclosingGenericClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingGenericClass.kt"); + } + + @Test + @TestMetadata("EnclosingImplicitlyGenericInnerClass.kt") + public void testEnclosingImplicitlyGenericInnerClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingImplicitlyGenericInnerClass.kt"); + } + + @Test + @TestMetadata("EnclosingInnerClass.kt") + public void testEnclosingInnerClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingInnerClass.kt"); + } + + @Test + @TestMetadata("EnumerationType.kt") + public void testEnumerationType() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnumerationType.kt"); + } + + @Test + @TestMetadata("ExplicitlyGenericInnerClass.kt") + public void testExplicitlyGenericInnerClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/ExplicitlyGenericInnerClass.kt"); + } + + @Test + @TestMetadata("FunctionWithParameterToUnit.kt") + public void testFunctionWithParameterToUnit() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/FunctionWithParameterToUnit.kt"); + } + + @Test + @TestMetadata("FunctionWithReceiverToUnit.kt") + public void testFunctionWithReceiverToUnit() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/FunctionWithReceiverToUnit.kt"); + } + + @Test + @TestMetadata("GenericLocalClass.kt") + public void testGenericLocalClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericLocalClass.kt"); + } + + @Test + @TestMetadata("GenericLocalClassWithLeakingTypeParameter.kt") + public void testGenericLocalClassWithLeakingTypeParameter() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericLocalClassWithLeakingTypeParameter.kt"); + } + + @Test + @TestMetadata("GenericWithContravariantTypeParameter.kt") + public void testGenericWithContravariantTypeParameter() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithContravariantTypeParameter.kt"); + } + + @Test + @TestMetadata("GenericWithCovariantTypeParameter.kt") + public void testGenericWithCovariantTypeParameter() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithCovariantTypeParameter.kt"); + } + + @Test + @TestMetadata("GenericWithInProjectedTypeArgument.kt") + public void testGenericWithInProjectedTypeArgument() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithInProjectedTypeArgument.kt"); + } + + @Test + @TestMetadata("GenericWithInvariantTypeParameter.kt") + public void testGenericWithInvariantTypeParameter() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithInvariantTypeParameter.kt"); + } + + @Test + @TestMetadata("GenericWithOutProjectedTypeArgument.kt") + public void testGenericWithOutProjectedTypeArgument() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithOutProjectedTypeArgument.kt"); + } + + @Test + @TestMetadata("GenericWithStarProjectedTypeArgument.kt") + public void testGenericWithStarProjectedTypeArgument() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithStarProjectedTypeArgument.kt"); + } + + @Test + @TestMetadata("ImplicitlyGenericInnerClass.kt") + public void testImplicitlyGenericInnerClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/ImplicitlyGenericInnerClass.kt"); + } + + @Test + @TestMetadata("InnerClass.kt") + public void testInnerClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/InnerClass.kt"); + } + + @Test + @TestMetadata("Int.kt") + public void testInt() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/Int.kt"); + } + + @Test + @TestMetadata("IntersectionType.kt") + public void testIntersectionType() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/IntersectionType.kt"); + } + + @Test + @TestMetadata("LocalClass.kt") + public void testLocalClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/LocalClass.kt"); + } + + @Test + @TestMetadata("NothingYieldCase.kt") + public void testNothingYieldCase() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NothingYieldCase.kt"); + } + + @Test + @TestMetadata("NullableNothing.kt") + public void testNullableNothing() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullableNothing.kt"); + } + + @Test + @TestMetadata("NullableNothingNullLiteralYieldCase.kt") + public void testNullableNothingNullLiteralYieldCase() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullableNothingNullLiteralYieldCase.kt"); + } + + @Test + @TestMetadata("NullableType.kt") + public void testNullableType() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullableType.kt"); + } + + @Test + @TestMetadata("NullableTypeParameter.kt") + public void testNullableTypeParameter() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullableTypeParameter.kt"); + } + + @Test + @TestMetadata("NullaryFunctionToUnit.kt") + public void testNullaryFunctionToUnit() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullaryFunctionToUnit.kt"); + } + + @Test + @TestMetadata("NullaryFunctionWithReturnValue.kt") + public void testNullaryFunctionWithReturnValue() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullaryFunctionWithReturnValue.kt"); + } + + @Test + @TestMetadata("String.kt") + public void testString() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/String.kt"); + } + + @Test + @TestMetadata("SuspendingFunction.kt") + public void testSuspendingFunction() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/SuspendingFunction.kt"); + } + + @Test + @TestMetadata("TypeParameter.kt") + public void testTypeParameter() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/TypeParameter.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 71dab051ae3..a3919bb2c18 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 @@ -1945,6 +1945,232 @@ public class IrJsES6CodegenBoxTestGenerated extends AbstractIrJsES6CodegenBoxTes runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/sourceSinkFeedContexts/ThroughLocalVariable.kt"); } } + + @Nested + @TestMetadata("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes") + @TestDataPath("$PROJECT_ROOT") + public class TargetTypes { + @Test + public void testAllFilesPresentInTargetTypes() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true); + } + + @Test + @TestMetadata("AnonymousObject.kt") + public void testAnonymousObject() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/AnonymousObject.kt"); + } + + @Test + @TestMetadata("DefinitelyNonNullableTypeParameter.kt") + public void testDefinitelyNonNullableTypeParameter() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/DefinitelyNonNullableTypeParameter.kt"); + } + + @Test + @TestMetadata("EnclosingClass.kt") + public void testEnclosingClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingClass.kt"); + } + + @Test + @TestMetadata("EnclosingEnumerationEntryType.kt") + public void testEnclosingEnumerationEntryType() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingEnumerationEntryType.kt"); + } + + @Test + @TestMetadata("EnclosingEnumerationType.kt") + public void testEnclosingEnumerationType() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingEnumerationType.kt"); + } + + @Test + @TestMetadata("EnclosingExplicitlyGenericInnerClass.kt") + public void testEnclosingExplicitlyGenericInnerClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingExplicitlyGenericInnerClass.kt"); + } + + @Test + @TestMetadata("EnclosingGenericClass.kt") + public void testEnclosingGenericClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingGenericClass.kt"); + } + + @Test + @TestMetadata("EnclosingImplicitlyGenericInnerClass.kt") + public void testEnclosingImplicitlyGenericInnerClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingImplicitlyGenericInnerClass.kt"); + } + + @Test + @TestMetadata("EnclosingInnerClass.kt") + public void testEnclosingInnerClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingInnerClass.kt"); + } + + @Test + @TestMetadata("EnumerationType.kt") + public void testEnumerationType() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnumerationType.kt"); + } + + @Test + @TestMetadata("ExplicitlyGenericInnerClass.kt") + public void testExplicitlyGenericInnerClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/ExplicitlyGenericInnerClass.kt"); + } + + @Test + @TestMetadata("FunctionWithParameterToUnit.kt") + public void testFunctionWithParameterToUnit() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/FunctionWithParameterToUnit.kt"); + } + + @Test + @TestMetadata("FunctionWithReceiverToUnit.kt") + public void testFunctionWithReceiverToUnit() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/FunctionWithReceiverToUnit.kt"); + } + + @Test + @TestMetadata("GenericLocalClass.kt") + public void testGenericLocalClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericLocalClass.kt"); + } + + @Test + @TestMetadata("GenericLocalClassWithLeakingTypeParameter.kt") + public void testGenericLocalClassWithLeakingTypeParameter() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericLocalClassWithLeakingTypeParameter.kt"); + } + + @Test + @TestMetadata("GenericWithContravariantTypeParameter.kt") + public void testGenericWithContravariantTypeParameter() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithContravariantTypeParameter.kt"); + } + + @Test + @TestMetadata("GenericWithCovariantTypeParameter.kt") + public void testGenericWithCovariantTypeParameter() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithCovariantTypeParameter.kt"); + } + + @Test + @TestMetadata("GenericWithInProjectedTypeArgument.kt") + public void testGenericWithInProjectedTypeArgument() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithInProjectedTypeArgument.kt"); + } + + @Test + @TestMetadata("GenericWithInvariantTypeParameter.kt") + public void testGenericWithInvariantTypeParameter() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithInvariantTypeParameter.kt"); + } + + @Test + @TestMetadata("GenericWithOutProjectedTypeArgument.kt") + public void testGenericWithOutProjectedTypeArgument() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithOutProjectedTypeArgument.kt"); + } + + @Test + @TestMetadata("GenericWithStarProjectedTypeArgument.kt") + public void testGenericWithStarProjectedTypeArgument() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithStarProjectedTypeArgument.kt"); + } + + @Test + @TestMetadata("ImplicitlyGenericInnerClass.kt") + public void testImplicitlyGenericInnerClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/ImplicitlyGenericInnerClass.kt"); + } + + @Test + @TestMetadata("InnerClass.kt") + public void testInnerClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/InnerClass.kt"); + } + + @Test + @TestMetadata("Int.kt") + public void testInt() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/Int.kt"); + } + + @Test + @TestMetadata("IntersectionType.kt") + public void testIntersectionType() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/IntersectionType.kt"); + } + + @Test + @TestMetadata("LocalClass.kt") + public void testLocalClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/LocalClass.kt"); + } + + @Test + @TestMetadata("NothingYieldCase.kt") + public void testNothingYieldCase() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NothingYieldCase.kt"); + } + + @Test + @TestMetadata("NullableNothing.kt") + public void testNullableNothing() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullableNothing.kt"); + } + + @Test + @TestMetadata("NullableNothingNullLiteralYieldCase.kt") + public void testNullableNothingNullLiteralYieldCase() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullableNothingNullLiteralYieldCase.kt"); + } + + @Test + @TestMetadata("NullableType.kt") + public void testNullableType() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullableType.kt"); + } + + @Test + @TestMetadata("NullableTypeParameter.kt") + public void testNullableTypeParameter() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullableTypeParameter.kt"); + } + + @Test + @TestMetadata("NullaryFunctionToUnit.kt") + public void testNullaryFunctionToUnit() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullaryFunctionToUnit.kt"); + } + + @Test + @TestMetadata("NullaryFunctionWithReturnValue.kt") + public void testNullaryFunctionWithReturnValue() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullaryFunctionWithReturnValue.kt"); + } + + @Test + @TestMetadata("String.kt") + public void testString() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/String.kt"); + } + + @Test + @TestMetadata("SuspendingFunction.kt") + public void testSuspendingFunction() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/SuspendingFunction.kt"); + } + + @Test + @TestMetadata("TypeParameter.kt") + public void testTypeParameter() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/TypeParameter.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 4ed6ef90e57..e06eaa3d513 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 @@ -2016,6 +2016,235 @@ public class FirNativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTe runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/sourceSinkFeedContexts/ThroughLocalVariable.kt"); } } + + @Nested + @TestMetadata("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes") + @TestDataPath("$PROJECT_ROOT") + @Tag("frontend-fir") + @FirPipeline() + @UseExtTestCaseGroupProvider() + public class TargetTypes { + @Test + public void testAllFilesPresentInTargetTypes() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.NATIVE, true); + } + + @Test + @TestMetadata("AnonymousObject.kt") + public void testAnonymousObject() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/AnonymousObject.kt"); + } + + @Test + @TestMetadata("DefinitelyNonNullableTypeParameter.kt") + public void testDefinitelyNonNullableTypeParameter() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/DefinitelyNonNullableTypeParameter.kt"); + } + + @Test + @TestMetadata("EnclosingClass.kt") + public void testEnclosingClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingClass.kt"); + } + + @Test + @TestMetadata("EnclosingEnumerationEntryType.kt") + public void testEnclosingEnumerationEntryType() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingEnumerationEntryType.kt"); + } + + @Test + @TestMetadata("EnclosingEnumerationType.kt") + public void testEnclosingEnumerationType() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingEnumerationType.kt"); + } + + @Test + @TestMetadata("EnclosingExplicitlyGenericInnerClass.kt") + public void testEnclosingExplicitlyGenericInnerClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingExplicitlyGenericInnerClass.kt"); + } + + @Test + @TestMetadata("EnclosingGenericClass.kt") + public void testEnclosingGenericClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingGenericClass.kt"); + } + + @Test + @TestMetadata("EnclosingImplicitlyGenericInnerClass.kt") + public void testEnclosingImplicitlyGenericInnerClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingImplicitlyGenericInnerClass.kt"); + } + + @Test + @TestMetadata("EnclosingInnerClass.kt") + public void testEnclosingInnerClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingInnerClass.kt"); + } + + @Test + @TestMetadata("EnumerationType.kt") + public void testEnumerationType() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnumerationType.kt"); + } + + @Test + @TestMetadata("ExplicitlyGenericInnerClass.kt") + public void testExplicitlyGenericInnerClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/ExplicitlyGenericInnerClass.kt"); + } + + @Test + @TestMetadata("FunctionWithParameterToUnit.kt") + public void testFunctionWithParameterToUnit() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/FunctionWithParameterToUnit.kt"); + } + + @Test + @TestMetadata("FunctionWithReceiverToUnit.kt") + public void testFunctionWithReceiverToUnit() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/FunctionWithReceiverToUnit.kt"); + } + + @Test + @TestMetadata("GenericLocalClass.kt") + public void testGenericLocalClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericLocalClass.kt"); + } + + @Test + @TestMetadata("GenericLocalClassWithLeakingTypeParameter.kt") + public void testGenericLocalClassWithLeakingTypeParameter() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericLocalClassWithLeakingTypeParameter.kt"); + } + + @Test + @TestMetadata("GenericWithContravariantTypeParameter.kt") + public void testGenericWithContravariantTypeParameter() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithContravariantTypeParameter.kt"); + } + + @Test + @TestMetadata("GenericWithCovariantTypeParameter.kt") + public void testGenericWithCovariantTypeParameter() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithCovariantTypeParameter.kt"); + } + + @Test + @TestMetadata("GenericWithInProjectedTypeArgument.kt") + public void testGenericWithInProjectedTypeArgument() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithInProjectedTypeArgument.kt"); + } + + @Test + @TestMetadata("GenericWithInvariantTypeParameter.kt") + public void testGenericWithInvariantTypeParameter() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithInvariantTypeParameter.kt"); + } + + @Test + @TestMetadata("GenericWithOutProjectedTypeArgument.kt") + public void testGenericWithOutProjectedTypeArgument() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithOutProjectedTypeArgument.kt"); + } + + @Test + @TestMetadata("GenericWithStarProjectedTypeArgument.kt") + public void testGenericWithStarProjectedTypeArgument() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithStarProjectedTypeArgument.kt"); + } + + @Test + @TestMetadata("ImplicitlyGenericInnerClass.kt") + public void testImplicitlyGenericInnerClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/ImplicitlyGenericInnerClass.kt"); + } + + @Test + @TestMetadata("InnerClass.kt") + public void testInnerClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/InnerClass.kt"); + } + + @Test + @TestMetadata("Int.kt") + public void testInt() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/Int.kt"); + } + + @Test + @TestMetadata("IntersectionType.kt") + public void testIntersectionType() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/IntersectionType.kt"); + } + + @Test + @TestMetadata("LocalClass.kt") + public void testLocalClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/LocalClass.kt"); + } + + @Test + @TestMetadata("NothingYieldCase.kt") + public void testNothingYieldCase() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NothingYieldCase.kt"); + } + + @Test + @TestMetadata("NullableNothing.kt") + public void testNullableNothing() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullableNothing.kt"); + } + + @Test + @TestMetadata("NullableNothingNullLiteralYieldCase.kt") + public void testNullableNothingNullLiteralYieldCase() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullableNothingNullLiteralYieldCase.kt"); + } + + @Test + @TestMetadata("NullableType.kt") + public void testNullableType() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullableType.kt"); + } + + @Test + @TestMetadata("NullableTypeParameter.kt") + public void testNullableTypeParameter() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullableTypeParameter.kt"); + } + + @Test + @TestMetadata("NullaryFunctionToUnit.kt") + public void testNullaryFunctionToUnit() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullaryFunctionToUnit.kt"); + } + + @Test + @TestMetadata("NullaryFunctionWithReturnValue.kt") + public void testNullaryFunctionWithReturnValue() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullaryFunctionWithReturnValue.kt"); + } + + @Test + @TestMetadata("String.kt") + public void testString() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/String.kt"); + } + + @Test + @TestMetadata("SuspendingFunction.kt") + public void testSuspendingFunction() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/SuspendingFunction.kt"); + } + + @Test + @TestMetadata("TypeParameter.kt") + public void testTypeParameter() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/TypeParameter.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 e06c10a6fe3..464c2af88af 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 @@ -2070,6 +2070,237 @@ public class FirNativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenB runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/sourceSinkFeedContexts/ThroughLocalVariable.kt"); } } + + @Nested + @TestMetadata("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes") + @TestDataPath("$PROJECT_ROOT") + @Tag("frontend-fir") + @FirPipeline() + @UseExtTestCaseGroupProvider() + @UsePartialLinkage(mode = Mode.DISABLED) + @Tag("no-partial-linkage-may-be-skipped") + public class TargetTypes { + @Test + public void testAllFilesPresentInTargetTypes() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.NATIVE, true); + } + + @Test + @TestMetadata("AnonymousObject.kt") + public void testAnonymousObject() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/AnonymousObject.kt"); + } + + @Test + @TestMetadata("DefinitelyNonNullableTypeParameter.kt") + public void testDefinitelyNonNullableTypeParameter() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/DefinitelyNonNullableTypeParameter.kt"); + } + + @Test + @TestMetadata("EnclosingClass.kt") + public void testEnclosingClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingClass.kt"); + } + + @Test + @TestMetadata("EnclosingEnumerationEntryType.kt") + public void testEnclosingEnumerationEntryType() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingEnumerationEntryType.kt"); + } + + @Test + @TestMetadata("EnclosingEnumerationType.kt") + public void testEnclosingEnumerationType() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingEnumerationType.kt"); + } + + @Test + @TestMetadata("EnclosingExplicitlyGenericInnerClass.kt") + public void testEnclosingExplicitlyGenericInnerClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingExplicitlyGenericInnerClass.kt"); + } + + @Test + @TestMetadata("EnclosingGenericClass.kt") + public void testEnclosingGenericClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingGenericClass.kt"); + } + + @Test + @TestMetadata("EnclosingImplicitlyGenericInnerClass.kt") + public void testEnclosingImplicitlyGenericInnerClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingImplicitlyGenericInnerClass.kt"); + } + + @Test + @TestMetadata("EnclosingInnerClass.kt") + public void testEnclosingInnerClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingInnerClass.kt"); + } + + @Test + @TestMetadata("EnumerationType.kt") + public void testEnumerationType() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnumerationType.kt"); + } + + @Test + @TestMetadata("ExplicitlyGenericInnerClass.kt") + public void testExplicitlyGenericInnerClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/ExplicitlyGenericInnerClass.kt"); + } + + @Test + @TestMetadata("FunctionWithParameterToUnit.kt") + public void testFunctionWithParameterToUnit() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/FunctionWithParameterToUnit.kt"); + } + + @Test + @TestMetadata("FunctionWithReceiverToUnit.kt") + public void testFunctionWithReceiverToUnit() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/FunctionWithReceiverToUnit.kt"); + } + + @Test + @TestMetadata("GenericLocalClass.kt") + public void testGenericLocalClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericLocalClass.kt"); + } + + @Test + @TestMetadata("GenericLocalClassWithLeakingTypeParameter.kt") + public void testGenericLocalClassWithLeakingTypeParameter() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericLocalClassWithLeakingTypeParameter.kt"); + } + + @Test + @TestMetadata("GenericWithContravariantTypeParameter.kt") + public void testGenericWithContravariantTypeParameter() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithContravariantTypeParameter.kt"); + } + + @Test + @TestMetadata("GenericWithCovariantTypeParameter.kt") + public void testGenericWithCovariantTypeParameter() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithCovariantTypeParameter.kt"); + } + + @Test + @TestMetadata("GenericWithInProjectedTypeArgument.kt") + public void testGenericWithInProjectedTypeArgument() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithInProjectedTypeArgument.kt"); + } + + @Test + @TestMetadata("GenericWithInvariantTypeParameter.kt") + public void testGenericWithInvariantTypeParameter() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithInvariantTypeParameter.kt"); + } + + @Test + @TestMetadata("GenericWithOutProjectedTypeArgument.kt") + public void testGenericWithOutProjectedTypeArgument() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithOutProjectedTypeArgument.kt"); + } + + @Test + @TestMetadata("GenericWithStarProjectedTypeArgument.kt") + public void testGenericWithStarProjectedTypeArgument() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithStarProjectedTypeArgument.kt"); + } + + @Test + @TestMetadata("ImplicitlyGenericInnerClass.kt") + public void testImplicitlyGenericInnerClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/ImplicitlyGenericInnerClass.kt"); + } + + @Test + @TestMetadata("InnerClass.kt") + public void testInnerClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/InnerClass.kt"); + } + + @Test + @TestMetadata("Int.kt") + public void testInt() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/Int.kt"); + } + + @Test + @TestMetadata("IntersectionType.kt") + public void testIntersectionType() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/IntersectionType.kt"); + } + + @Test + @TestMetadata("LocalClass.kt") + public void testLocalClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/LocalClass.kt"); + } + + @Test + @TestMetadata("NothingYieldCase.kt") + public void testNothingYieldCase() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NothingYieldCase.kt"); + } + + @Test + @TestMetadata("NullableNothing.kt") + public void testNullableNothing() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullableNothing.kt"); + } + + @Test + @TestMetadata("NullableNothingNullLiteralYieldCase.kt") + public void testNullableNothingNullLiteralYieldCase() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullableNothingNullLiteralYieldCase.kt"); + } + + @Test + @TestMetadata("NullableType.kt") + public void testNullableType() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullableType.kt"); + } + + @Test + @TestMetadata("NullableTypeParameter.kt") + public void testNullableTypeParameter() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullableTypeParameter.kt"); + } + + @Test + @TestMetadata("NullaryFunctionToUnit.kt") + public void testNullaryFunctionToUnit() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullaryFunctionToUnit.kt"); + } + + @Test + @TestMetadata("NullaryFunctionWithReturnValue.kt") + public void testNullaryFunctionWithReturnValue() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullaryFunctionWithReturnValue.kt"); + } + + @Test + @TestMetadata("String.kt") + public void testString() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/String.kt"); + } + + @Test + @TestMetadata("SuspendingFunction.kt") + public void testSuspendingFunction() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/SuspendingFunction.kt"); + } + + @Test + @TestMetadata("TypeParameter.kt") + public void testTypeParameter() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/TypeParameter.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 122a896a74d..cbcb2839376 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 @@ -1990,6 +1990,234 @@ public class NativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTest runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/sourceSinkFeedContexts/ThroughLocalVariable.kt"); } } + + @Nested + @TestMetadata("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes") + @TestDataPath("$PROJECT_ROOT") + @UseExtTestCaseGroupProvider() + @DisabledTestsIfProperty(sourceLocations = { "compiler/testData/codegen/box/coroutines/featureIntersection/defaultExpect.kt", "compiler/testData/codegen/box/multiplatform/defaultArguments/*.kt", "compiler/testData/codegen/box/multiplatform/migratedOldTests/*.kt", "compiler/testData/codegen/boxInline/multiplatform/defaultArguments/receiversAndParametersInLambda.kt" }, property = ClassLevelProperty.TEST_MODE, propertyValue = "ONE_STAGE_MULTI_MODULE") + public class TargetTypes { + @Test + public void testAllFilesPresentInTargetTypes() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.NATIVE, true); + } + + @Test + @TestMetadata("AnonymousObject.kt") + public void testAnonymousObject() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/AnonymousObject.kt"); + } + + @Test + @TestMetadata("DefinitelyNonNullableTypeParameter.kt") + public void testDefinitelyNonNullableTypeParameter() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/DefinitelyNonNullableTypeParameter.kt"); + } + + @Test + @TestMetadata("EnclosingClass.kt") + public void testEnclosingClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingClass.kt"); + } + + @Test + @TestMetadata("EnclosingEnumerationEntryType.kt") + public void testEnclosingEnumerationEntryType() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingEnumerationEntryType.kt"); + } + + @Test + @TestMetadata("EnclosingEnumerationType.kt") + public void testEnclosingEnumerationType() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingEnumerationType.kt"); + } + + @Test + @TestMetadata("EnclosingExplicitlyGenericInnerClass.kt") + public void testEnclosingExplicitlyGenericInnerClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingExplicitlyGenericInnerClass.kt"); + } + + @Test + @TestMetadata("EnclosingGenericClass.kt") + public void testEnclosingGenericClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingGenericClass.kt"); + } + + @Test + @TestMetadata("EnclosingImplicitlyGenericInnerClass.kt") + public void testEnclosingImplicitlyGenericInnerClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingImplicitlyGenericInnerClass.kt"); + } + + @Test + @TestMetadata("EnclosingInnerClass.kt") + public void testEnclosingInnerClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingInnerClass.kt"); + } + + @Test + @TestMetadata("EnumerationType.kt") + public void testEnumerationType() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnumerationType.kt"); + } + + @Test + @TestMetadata("ExplicitlyGenericInnerClass.kt") + public void testExplicitlyGenericInnerClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/ExplicitlyGenericInnerClass.kt"); + } + + @Test + @TestMetadata("FunctionWithParameterToUnit.kt") + public void testFunctionWithParameterToUnit() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/FunctionWithParameterToUnit.kt"); + } + + @Test + @TestMetadata("FunctionWithReceiverToUnit.kt") + public void testFunctionWithReceiverToUnit() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/FunctionWithReceiverToUnit.kt"); + } + + @Test + @TestMetadata("GenericLocalClass.kt") + public void testGenericLocalClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericLocalClass.kt"); + } + + @Test + @TestMetadata("GenericLocalClassWithLeakingTypeParameter.kt") + public void testGenericLocalClassWithLeakingTypeParameter() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericLocalClassWithLeakingTypeParameter.kt"); + } + + @Test + @TestMetadata("GenericWithContravariantTypeParameter.kt") + public void testGenericWithContravariantTypeParameter() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithContravariantTypeParameter.kt"); + } + + @Test + @TestMetadata("GenericWithCovariantTypeParameter.kt") + public void testGenericWithCovariantTypeParameter() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithCovariantTypeParameter.kt"); + } + + @Test + @TestMetadata("GenericWithInProjectedTypeArgument.kt") + public void testGenericWithInProjectedTypeArgument() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithInProjectedTypeArgument.kt"); + } + + @Test + @TestMetadata("GenericWithInvariantTypeParameter.kt") + public void testGenericWithInvariantTypeParameter() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithInvariantTypeParameter.kt"); + } + + @Test + @TestMetadata("GenericWithOutProjectedTypeArgument.kt") + public void testGenericWithOutProjectedTypeArgument() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithOutProjectedTypeArgument.kt"); + } + + @Test + @TestMetadata("GenericWithStarProjectedTypeArgument.kt") + public void testGenericWithStarProjectedTypeArgument() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithStarProjectedTypeArgument.kt"); + } + + @Test + @TestMetadata("ImplicitlyGenericInnerClass.kt") + public void testImplicitlyGenericInnerClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/ImplicitlyGenericInnerClass.kt"); + } + + @Test + @TestMetadata("InnerClass.kt") + public void testInnerClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/InnerClass.kt"); + } + + @Test + @TestMetadata("Int.kt") + public void testInt() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/Int.kt"); + } + + @Test + @TestMetadata("IntersectionType.kt") + public void testIntersectionType() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/IntersectionType.kt"); + } + + @Test + @TestMetadata("LocalClass.kt") + public void testLocalClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/LocalClass.kt"); + } + + @Test + @TestMetadata("NothingYieldCase.kt") + public void testNothingYieldCase() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NothingYieldCase.kt"); + } + + @Test + @TestMetadata("NullableNothing.kt") + public void testNullableNothing() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullableNothing.kt"); + } + + @Test + @TestMetadata("NullableNothingNullLiteralYieldCase.kt") + public void testNullableNothingNullLiteralYieldCase() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullableNothingNullLiteralYieldCase.kt"); + } + + @Test + @TestMetadata("NullableType.kt") + public void testNullableType() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullableType.kt"); + } + + @Test + @TestMetadata("NullableTypeParameter.kt") + public void testNullableTypeParameter() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullableTypeParameter.kt"); + } + + @Test + @TestMetadata("NullaryFunctionToUnit.kt") + public void testNullaryFunctionToUnit() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullaryFunctionToUnit.kt"); + } + + @Test + @TestMetadata("NullaryFunctionWithReturnValue.kt") + public void testNullaryFunctionWithReturnValue() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullaryFunctionWithReturnValue.kt"); + } + + @Test + @TestMetadata("String.kt") + public void testString() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/String.kt"); + } + + @Test + @TestMetadata("SuspendingFunction.kt") + public void testSuspendingFunction() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/SuspendingFunction.kt"); + } + + @Test + @TestMetadata("TypeParameter.kt") + public void testTypeParameter() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/TypeParameter.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 d4cc79cd954..9216375f6de 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 @@ -2017,6 +2017,235 @@ public class NativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenBoxT runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/sourceSinkFeedContexts/ThroughLocalVariable.kt"); } } + + @Nested + @TestMetadata("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes") + @TestDataPath("$PROJECT_ROOT") + @UseExtTestCaseGroupProvider() + @UsePartialLinkage(mode = Mode.DISABLED) + @Tag("no-partial-linkage-may-be-skipped") + public class TargetTypes { + @Test + public void testAllFilesPresentInTargetTypes() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.NATIVE, true); + } + + @Test + @TestMetadata("AnonymousObject.kt") + public void testAnonymousObject() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/AnonymousObject.kt"); + } + + @Test + @TestMetadata("DefinitelyNonNullableTypeParameter.kt") + public void testDefinitelyNonNullableTypeParameter() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/DefinitelyNonNullableTypeParameter.kt"); + } + + @Test + @TestMetadata("EnclosingClass.kt") + public void testEnclosingClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingClass.kt"); + } + + @Test + @TestMetadata("EnclosingEnumerationEntryType.kt") + public void testEnclosingEnumerationEntryType() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingEnumerationEntryType.kt"); + } + + @Test + @TestMetadata("EnclosingEnumerationType.kt") + public void testEnclosingEnumerationType() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingEnumerationType.kt"); + } + + @Test + @TestMetadata("EnclosingExplicitlyGenericInnerClass.kt") + public void testEnclosingExplicitlyGenericInnerClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingExplicitlyGenericInnerClass.kt"); + } + + @Test + @TestMetadata("EnclosingGenericClass.kt") + public void testEnclosingGenericClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingGenericClass.kt"); + } + + @Test + @TestMetadata("EnclosingImplicitlyGenericInnerClass.kt") + public void testEnclosingImplicitlyGenericInnerClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingImplicitlyGenericInnerClass.kt"); + } + + @Test + @TestMetadata("EnclosingInnerClass.kt") + public void testEnclosingInnerClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingInnerClass.kt"); + } + + @Test + @TestMetadata("EnumerationType.kt") + public void testEnumerationType() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnumerationType.kt"); + } + + @Test + @TestMetadata("ExplicitlyGenericInnerClass.kt") + public void testExplicitlyGenericInnerClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/ExplicitlyGenericInnerClass.kt"); + } + + @Test + @TestMetadata("FunctionWithParameterToUnit.kt") + public void testFunctionWithParameterToUnit() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/FunctionWithParameterToUnit.kt"); + } + + @Test + @TestMetadata("FunctionWithReceiverToUnit.kt") + public void testFunctionWithReceiverToUnit() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/FunctionWithReceiverToUnit.kt"); + } + + @Test + @TestMetadata("GenericLocalClass.kt") + public void testGenericLocalClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericLocalClass.kt"); + } + + @Test + @TestMetadata("GenericLocalClassWithLeakingTypeParameter.kt") + public void testGenericLocalClassWithLeakingTypeParameter() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericLocalClassWithLeakingTypeParameter.kt"); + } + + @Test + @TestMetadata("GenericWithContravariantTypeParameter.kt") + public void testGenericWithContravariantTypeParameter() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithContravariantTypeParameter.kt"); + } + + @Test + @TestMetadata("GenericWithCovariantTypeParameter.kt") + public void testGenericWithCovariantTypeParameter() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithCovariantTypeParameter.kt"); + } + + @Test + @TestMetadata("GenericWithInProjectedTypeArgument.kt") + public void testGenericWithInProjectedTypeArgument() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithInProjectedTypeArgument.kt"); + } + + @Test + @TestMetadata("GenericWithInvariantTypeParameter.kt") + public void testGenericWithInvariantTypeParameter() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithInvariantTypeParameter.kt"); + } + + @Test + @TestMetadata("GenericWithOutProjectedTypeArgument.kt") + public void testGenericWithOutProjectedTypeArgument() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithOutProjectedTypeArgument.kt"); + } + + @Test + @TestMetadata("GenericWithStarProjectedTypeArgument.kt") + public void testGenericWithStarProjectedTypeArgument() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithStarProjectedTypeArgument.kt"); + } + + @Test + @TestMetadata("ImplicitlyGenericInnerClass.kt") + public void testImplicitlyGenericInnerClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/ImplicitlyGenericInnerClass.kt"); + } + + @Test + @TestMetadata("InnerClass.kt") + public void testInnerClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/InnerClass.kt"); + } + + @Test + @TestMetadata("Int.kt") + public void testInt() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/Int.kt"); + } + + @Test + @TestMetadata("IntersectionType.kt") + public void testIntersectionType() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/IntersectionType.kt"); + } + + @Test + @TestMetadata("LocalClass.kt") + public void testLocalClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/LocalClass.kt"); + } + + @Test + @TestMetadata("NothingYieldCase.kt") + public void testNothingYieldCase() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NothingYieldCase.kt"); + } + + @Test + @TestMetadata("NullableNothing.kt") + public void testNullableNothing() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullableNothing.kt"); + } + + @Test + @TestMetadata("NullableNothingNullLiteralYieldCase.kt") + public void testNullableNothingNullLiteralYieldCase() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullableNothingNullLiteralYieldCase.kt"); + } + + @Test + @TestMetadata("NullableType.kt") + public void testNullableType() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullableType.kt"); + } + + @Test + @TestMetadata("NullableTypeParameter.kt") + public void testNullableTypeParameter() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullableTypeParameter.kt"); + } + + @Test + @TestMetadata("NullaryFunctionToUnit.kt") + public void testNullaryFunctionToUnit() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullaryFunctionToUnit.kt"); + } + + @Test + @TestMetadata("NullaryFunctionWithReturnValue.kt") + public void testNullaryFunctionWithReturnValue() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullaryFunctionWithReturnValue.kt"); + } + + @Test + @TestMetadata("String.kt") + public void testString() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/String.kt"); + } + + @Test + @TestMetadata("SuspendingFunction.kt") + public void testSuspendingFunction() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/SuspendingFunction.kt"); + } + + @Test + @TestMetadata("TypeParameter.kt") + public void testTypeParameter() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/TypeParameter.kt"); + } + } } } } 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 fede0f3caa6..9329f6e0b34 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 @@ -1933,6 +1933,232 @@ public class FirWasmCodegenBoxTestGenerated extends AbstractFirWasmCodegenBoxTes runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/sourceSinkFeedContexts/ThroughLocalVariable.kt"); } } + + @Nested + @TestMetadata("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes") + @TestDataPath("$PROJECT_ROOT") + public class TargetTypes { + @Test + public void testAllFilesPresentInTargetTypes() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.WASM, true); + } + + @Test + @TestMetadata("AnonymousObject.kt") + public void testAnonymousObject() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/AnonymousObject.kt"); + } + + @Test + @TestMetadata("DefinitelyNonNullableTypeParameter.kt") + public void testDefinitelyNonNullableTypeParameter() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/DefinitelyNonNullableTypeParameter.kt"); + } + + @Test + @TestMetadata("EnclosingClass.kt") + public void testEnclosingClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingClass.kt"); + } + + @Test + @TestMetadata("EnclosingEnumerationEntryType.kt") + public void testEnclosingEnumerationEntryType() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingEnumerationEntryType.kt"); + } + + @Test + @TestMetadata("EnclosingEnumerationType.kt") + public void testEnclosingEnumerationType() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingEnumerationType.kt"); + } + + @Test + @TestMetadata("EnclosingExplicitlyGenericInnerClass.kt") + public void testEnclosingExplicitlyGenericInnerClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingExplicitlyGenericInnerClass.kt"); + } + + @Test + @TestMetadata("EnclosingGenericClass.kt") + public void testEnclosingGenericClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingGenericClass.kt"); + } + + @Test + @TestMetadata("EnclosingImplicitlyGenericInnerClass.kt") + public void testEnclosingImplicitlyGenericInnerClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingImplicitlyGenericInnerClass.kt"); + } + + @Test + @TestMetadata("EnclosingInnerClass.kt") + public void testEnclosingInnerClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingInnerClass.kt"); + } + + @Test + @TestMetadata("EnumerationType.kt") + public void testEnumerationType() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnumerationType.kt"); + } + + @Test + @TestMetadata("ExplicitlyGenericInnerClass.kt") + public void testExplicitlyGenericInnerClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/ExplicitlyGenericInnerClass.kt"); + } + + @Test + @TestMetadata("FunctionWithParameterToUnit.kt") + public void testFunctionWithParameterToUnit() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/FunctionWithParameterToUnit.kt"); + } + + @Test + @TestMetadata("FunctionWithReceiverToUnit.kt") + public void testFunctionWithReceiverToUnit() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/FunctionWithReceiverToUnit.kt"); + } + + @Test + @TestMetadata("GenericLocalClass.kt") + public void testGenericLocalClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericLocalClass.kt"); + } + + @Test + @TestMetadata("GenericLocalClassWithLeakingTypeParameter.kt") + public void testGenericLocalClassWithLeakingTypeParameter() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericLocalClassWithLeakingTypeParameter.kt"); + } + + @Test + @TestMetadata("GenericWithContravariantTypeParameter.kt") + public void testGenericWithContravariantTypeParameter() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithContravariantTypeParameter.kt"); + } + + @Test + @TestMetadata("GenericWithCovariantTypeParameter.kt") + public void testGenericWithCovariantTypeParameter() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithCovariantTypeParameter.kt"); + } + + @Test + @TestMetadata("GenericWithInProjectedTypeArgument.kt") + public void testGenericWithInProjectedTypeArgument() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithInProjectedTypeArgument.kt"); + } + + @Test + @TestMetadata("GenericWithInvariantTypeParameter.kt") + public void testGenericWithInvariantTypeParameter() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithInvariantTypeParameter.kt"); + } + + @Test + @TestMetadata("GenericWithOutProjectedTypeArgument.kt") + public void testGenericWithOutProjectedTypeArgument() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithOutProjectedTypeArgument.kt"); + } + + @Test + @TestMetadata("GenericWithStarProjectedTypeArgument.kt") + public void testGenericWithStarProjectedTypeArgument() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithStarProjectedTypeArgument.kt"); + } + + @Test + @TestMetadata("ImplicitlyGenericInnerClass.kt") + public void testImplicitlyGenericInnerClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/ImplicitlyGenericInnerClass.kt"); + } + + @Test + @TestMetadata("InnerClass.kt") + public void testInnerClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/InnerClass.kt"); + } + + @Test + @TestMetadata("Int.kt") + public void testInt() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/Int.kt"); + } + + @Test + @TestMetadata("IntersectionType.kt") + public void testIntersectionType() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/IntersectionType.kt"); + } + + @Test + @TestMetadata("LocalClass.kt") + public void testLocalClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/LocalClass.kt"); + } + + @Test + @TestMetadata("NothingYieldCase.kt") + public void testNothingYieldCase() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NothingYieldCase.kt"); + } + + @Test + @TestMetadata("NullableNothing.kt") + public void testNullableNothing() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullableNothing.kt"); + } + + @Test + @TestMetadata("NullableNothingNullLiteralYieldCase.kt") + public void testNullableNothingNullLiteralYieldCase() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullableNothingNullLiteralYieldCase.kt"); + } + + @Test + @TestMetadata("NullableType.kt") + public void testNullableType() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullableType.kt"); + } + + @Test + @TestMetadata("NullableTypeParameter.kt") + public void testNullableTypeParameter() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullableTypeParameter.kt"); + } + + @Test + @TestMetadata("NullaryFunctionToUnit.kt") + public void testNullaryFunctionToUnit() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullaryFunctionToUnit.kt"); + } + + @Test + @TestMetadata("NullaryFunctionWithReturnValue.kt") + public void testNullaryFunctionWithReturnValue() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullaryFunctionWithReturnValue.kt"); + } + + @Test + @TestMetadata("String.kt") + public void testString() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/String.kt"); + } + + @Test + @TestMetadata("SuspendingFunction.kt") + public void testSuspendingFunction() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/SuspendingFunction.kt"); + } + + @Test + @TestMetadata("TypeParameter.kt") + public void testTypeParameter() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/TypeParameter.kt"); + } + } } } } 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 ae443deba30..6a8d8f7dab1 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 @@ -1933,6 +1933,232 @@ public class K1WasmCodegenBoxTestGenerated extends AbstractK1WasmCodegenBoxTest runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/sourceSinkFeedContexts/ThroughLocalVariable.kt"); } } + + @Nested + @TestMetadata("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes") + @TestDataPath("$PROJECT_ROOT") + public class TargetTypes { + @Test + public void testAllFilesPresentInTargetTypes() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.WASM, true); + } + + @Test + @TestMetadata("AnonymousObject.kt") + public void testAnonymousObject() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/AnonymousObject.kt"); + } + + @Test + @TestMetadata("DefinitelyNonNullableTypeParameter.kt") + public void testDefinitelyNonNullableTypeParameter() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/DefinitelyNonNullableTypeParameter.kt"); + } + + @Test + @TestMetadata("EnclosingClass.kt") + public void testEnclosingClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingClass.kt"); + } + + @Test + @TestMetadata("EnclosingEnumerationEntryType.kt") + public void testEnclosingEnumerationEntryType() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingEnumerationEntryType.kt"); + } + + @Test + @TestMetadata("EnclosingEnumerationType.kt") + public void testEnclosingEnumerationType() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingEnumerationType.kt"); + } + + @Test + @TestMetadata("EnclosingExplicitlyGenericInnerClass.kt") + public void testEnclosingExplicitlyGenericInnerClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingExplicitlyGenericInnerClass.kt"); + } + + @Test + @TestMetadata("EnclosingGenericClass.kt") + public void testEnclosingGenericClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingGenericClass.kt"); + } + + @Test + @TestMetadata("EnclosingImplicitlyGenericInnerClass.kt") + public void testEnclosingImplicitlyGenericInnerClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingImplicitlyGenericInnerClass.kt"); + } + + @Test + @TestMetadata("EnclosingInnerClass.kt") + public void testEnclosingInnerClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnclosingInnerClass.kt"); + } + + @Test + @TestMetadata("EnumerationType.kt") + public void testEnumerationType() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/EnumerationType.kt"); + } + + @Test + @TestMetadata("ExplicitlyGenericInnerClass.kt") + public void testExplicitlyGenericInnerClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/ExplicitlyGenericInnerClass.kt"); + } + + @Test + @TestMetadata("FunctionWithParameterToUnit.kt") + public void testFunctionWithParameterToUnit() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/FunctionWithParameterToUnit.kt"); + } + + @Test + @TestMetadata("FunctionWithReceiverToUnit.kt") + public void testFunctionWithReceiverToUnit() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/FunctionWithReceiverToUnit.kt"); + } + + @Test + @TestMetadata("GenericLocalClass.kt") + public void testGenericLocalClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericLocalClass.kt"); + } + + @Test + @TestMetadata("GenericLocalClassWithLeakingTypeParameter.kt") + public void testGenericLocalClassWithLeakingTypeParameter() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericLocalClassWithLeakingTypeParameter.kt"); + } + + @Test + @TestMetadata("GenericWithContravariantTypeParameter.kt") + public void testGenericWithContravariantTypeParameter() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithContravariantTypeParameter.kt"); + } + + @Test + @TestMetadata("GenericWithCovariantTypeParameter.kt") + public void testGenericWithCovariantTypeParameter() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithCovariantTypeParameter.kt"); + } + + @Test + @TestMetadata("GenericWithInProjectedTypeArgument.kt") + public void testGenericWithInProjectedTypeArgument() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithInProjectedTypeArgument.kt"); + } + + @Test + @TestMetadata("GenericWithInvariantTypeParameter.kt") + public void testGenericWithInvariantTypeParameter() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithInvariantTypeParameter.kt"); + } + + @Test + @TestMetadata("GenericWithOutProjectedTypeArgument.kt") + public void testGenericWithOutProjectedTypeArgument() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithOutProjectedTypeArgument.kt"); + } + + @Test + @TestMetadata("GenericWithStarProjectedTypeArgument.kt") + public void testGenericWithStarProjectedTypeArgument() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/GenericWithStarProjectedTypeArgument.kt"); + } + + @Test + @TestMetadata("ImplicitlyGenericInnerClass.kt") + public void testImplicitlyGenericInnerClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/ImplicitlyGenericInnerClass.kt"); + } + + @Test + @TestMetadata("InnerClass.kt") + public void testInnerClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/InnerClass.kt"); + } + + @Test + @TestMetadata("Int.kt") + public void testInt() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/Int.kt"); + } + + @Test + @TestMetadata("IntersectionType.kt") + public void testIntersectionType() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/IntersectionType.kt"); + } + + @Test + @TestMetadata("LocalClass.kt") + public void testLocalClass() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/LocalClass.kt"); + } + + @Test + @TestMetadata("NothingYieldCase.kt") + public void testNothingYieldCase() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NothingYieldCase.kt"); + } + + @Test + @TestMetadata("NullableNothing.kt") + public void testNullableNothing() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullableNothing.kt"); + } + + @Test + @TestMetadata("NullableNothingNullLiteralYieldCase.kt") + public void testNullableNothingNullLiteralYieldCase() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullableNothingNullLiteralYieldCase.kt"); + } + + @Test + @TestMetadata("NullableType.kt") + public void testNullableType() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullableType.kt"); + } + + @Test + @TestMetadata("NullableTypeParameter.kt") + public void testNullableTypeParameter() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullableTypeParameter.kt"); + } + + @Test + @TestMetadata("NullaryFunctionToUnit.kt") + public void testNullaryFunctionToUnit() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullaryFunctionToUnit.kt"); + } + + @Test + @TestMetadata("NullaryFunctionWithReturnValue.kt") + public void testNullaryFunctionWithReturnValue() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/NullaryFunctionWithReturnValue.kt"); + } + + @Test + @TestMetadata("String.kt") + public void testString() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/String.kt"); + } + + @Test + @TestMetadata("SuspendingFunction.kt") + public void testSuspendingFunction() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/SuspendingFunction.kt"); + } + + @Test + @TestMetadata("TypeParameter.kt") + public void testTypeParameter() throws Exception { + runTest("compiler/testData/codegen/box/builderInference/oneParameter/oneTypeVariable/oneTypeInfoOrigin/targetTypes/TypeParameter.kt"); + } + } } } }