From 0c867b48041b8a140b422580351c857bce9363d1 Mon Sep 17 00:00:00 2001 From: Ilmir Usmanov Date: Mon, 30 Jul 2018 21:48:55 +0300 Subject: [PATCH] Disable callable references to suspend functions in 1.2 #KT-25604: Fixed --- .../DoubleColonExpressionResolver.kt | 5 +- .../callableReference/bound/emptyLHS.kt | 7 +- .../callableReference/fromJava.kt | 3 +- .../genericCallableReferenceArguments.kt | 7 +- ...ericCallableReferencesWithNullableTypes.kt | 7 +- .../function/getArityViaFunctionImpl.kt | 5 +- .../function/local/equalsHashCode.kt | 5 +- .../callableReference/longArgs.kt | 9 ++- .../box/coroutines/localCallableRef.kt | 6 +- .../box/reflection/modifiers/functions.kt | 2 + .../suspend/callableReference/simple.kt | 10 +-- .../callableReference/outsideSuspend.kt | 3 +- .../coroutines/callableReferences.kt | 2 + .../modifierFormForNonBuiltInSuspend.kt | 2 + ...ormForNonBuiltInSuspendWithAnyParameter.kt | 2 + .../coroutines/nonModifierFormForBuiltIn.kt | 2 + ...nonModifierFormForBuiltInRenameOnImport.kt | 2 + .../kotlin/test/KotlinTestUtils.java | 3 +- .../ir/IrBlackBoxCodegenTestGenerated.java | 79 ++++--------------- .../IrBlackBoxInlineCodegenTestGenerated.java | 13 +-- .../codegen/BlackBoxCodegenTestGenerated.java | 79 ++++--------------- .../BlackBoxInlineCodegenTestGenerated.java | 13 +-- ...otlinAgainstInlineKotlinTestGenerated.java | 13 +-- .../LightAnalysisModeTestGenerated.java | 79 ++++--------------- .../InlineSuspendTestsGenerated.java | 13 +-- .../IrJsCodegenBoxTestGenerated.java | 44 ++++------- .../semantics/JsCodegenBoxTestGenerated.java | 79 ++++--------------- 27 files changed, 131 insertions(+), 363 deletions(-) diff --git a/compiler/frontend/src/org/jetbrains/kotlin/types/expressions/DoubleColonExpressionResolver.kt b/compiler/frontend/src/org/jetbrains/kotlin/types/expressions/DoubleColonExpressionResolver.kt index 5e52218772a..9a0b07c0465 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/types/expressions/DoubleColonExpressionResolver.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/types/expressions/DoubleColonExpressionResolver.kt @@ -51,7 +51,6 @@ import org.jetbrains.kotlin.types.typeUtil.isSubtypeOf import org.jetbrains.kotlin.types.typeUtil.makeNotNullable import org.jetbrains.kotlin.types.typeUtil.makeNullable import org.jetbrains.kotlin.utils.yieldIfNotNull -import java.lang.UnsupportedOperationException import java.util.* import javax.inject.Inject import kotlin.coroutines.experimental.buildSequence @@ -646,6 +645,10 @@ class DoubleColonExpressionResolver( if (resolutionResults?.isSingleResult == true) resolutionResults.resultingDescriptor else null if (descriptor is PropertyDescriptor && descriptor.isBuiltInCoroutineContext(languageVersionSettings)) { context.trace.report(UNSUPPORTED.on(expression.callableReference, "Callable reference to suspend property")) + } else if (descriptor is FunctionDescriptor && descriptor.isSuspend + && !context.languageVersionSettings.supportsFeature(LanguageFeature.ReleaseCoroutines) + ) { + context.trace.report(UNSUPPORTED.on(expression.callableReference, "Callable reference to suspend function")) } val expressionResult = lhsResult as? DoubleColonLHS.Expression ?: return diff --git a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/emptyLHS.kt b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/emptyLHS.kt index cfbbf5b9549..1ee2060e0ba 100644 --- a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/emptyLHS.kt +++ b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/emptyLHS.kt @@ -1,12 +1,13 @@ -// IGNORE_BACKEND: JVM_IR +// !LANGUAGE: +ReleaseCoroutines +// !API_VERSION: 1.3 // IGNORE_BACKEND: JS, JS_IR +// IGNORE_BACKEND: JVM_IR -// COMMON_COROUTINES_TEST // WITH_RUNTIME // WITH_COROUTINES import helpers.* -import COROUTINES_PACKAGE.* +import kotlin.coroutines.* var result = "" diff --git a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/fromJava.kt b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/fromJava.kt index 1c7b99423a8..899de8bc52a 100644 --- a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/fromJava.kt +++ b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/fromJava.kt @@ -1,6 +1,7 @@ +// !LANGUAGE: +ReleaseCoroutines +// !API_VERSION: 1.3 // IGNORE_BACKEND: JS, JS_IR, NATIVE // IGNORE_BACKEND: JVM_IR -// COMMON_COROUTINES_TEST // WITH_COROUTINES // WITH_REFLECT diff --git a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/genericCallableReferenceArguments.kt b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/genericCallableReferenceArguments.kt index 4b365e2aa5a..0cdb6afa147 100644 --- a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/genericCallableReferenceArguments.kt +++ b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/genericCallableReferenceArguments.kt @@ -1,15 +1,16 @@ -// IGNORE_BACKEND: JVM_IR +// !LANGUAGE: +ReleaseCoroutines +// !API_VERSION: 1.3 // IGNORE_BACKEND: JS, NATIVE, JS_IR +// IGNORE_BACKEND: JVM_IR // WITH_REFLECT -// COMMON_COROUTINES_TEST // WITH_RUNTIME // WITH_COROUTINES import kotlin.test.assertEquals import helpers.* -import COROUTINES_PACKAGE.* +import kotlin.coroutines.* fun builder(c: suspend () -> Unit) { c.startCoroutine(EmptyContinuation) diff --git a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/genericCallableReferencesWithNullableTypes.kt b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/genericCallableReferencesWithNullableTypes.kt index 3f82abc895b..c03a2f0c4de 100644 --- a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/genericCallableReferencesWithNullableTypes.kt +++ b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/genericCallableReferencesWithNullableTypes.kt @@ -1,15 +1,16 @@ -// IGNORE_BACKEND: JVM_IR +// !LANGUAGE: +ReleaseCoroutines +// !API_VERSION: 1.3 // IGNORE_BACKEND: JS, JS_IR, NATIVE +// IGNORE_BACKEND: JVM_IR // WITH_REFLECT -// COMMON_COROUTINES_TEST // WITH_RUNTIME // WITH_COROUTINES import kotlin.test.assertEquals import helpers.* -import COROUTINES_PACKAGE.* +import kotlin.coroutines.* fun builder(c: suspend () -> Unit) { c.startCoroutine(EmptyContinuation) diff --git a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/getArityViaFunctionImpl.kt b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/getArityViaFunctionImpl.kt index 0cf60d75b59..86dc2af52b8 100644 --- a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/getArityViaFunctionImpl.kt +++ b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/getArityViaFunctionImpl.kt @@ -1,16 +1,17 @@ +// !LANGUAGE: +ReleaseCoroutines +// !API_VERSION: 1.3 // TODO: muted automatically, investigate should it be ran for JS or not // IGNORE_BACKEND: JVM_IR // IGNORE_BACKEND: JS, NATIVE, JS_IR // IGNORE_LIGHT_ANALYSIS -// LANGUAGE_VERSION: 1.2 // WITH_RUNTIME // WITH_COROUTINES import kotlin.test.assertEquals import kotlin.jvm.internal.FunctionBase import helpers.* -import kotlin.coroutines.experimental.* +import kotlin.coroutines.* suspend fun builder(c: suspend () -> Unit) { c.startCoroutine(EmptyContinuation) diff --git a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/equalsHashCode.kt b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/equalsHashCode.kt index 519505011f3..ec1b9de7a74 100644 --- a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/equalsHashCode.kt +++ b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/equalsHashCode.kt @@ -1,6 +1,7 @@ -// IGNORE_BACKEND: JVM_IR +// !LANGUAGE: +ReleaseCoroutines +// !API_VERSION: 1.3 // IGNORE_BACKEND: JS, NATIVE -// COMMON_COROUTINES_TEST +// IGNORE_BACKEND: JVM_IR fun box(): String { suspend fun bar() {} diff --git a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/longArgs.kt b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/longArgs.kt index 96235c58e9b..b81046cfa9a 100644 --- a/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/longArgs.kt +++ b/compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/longArgs.kt @@ -1,11 +1,12 @@ -// IGNORE_BACKEND: JVM_IR +// !LANGUAGE: +ReleaseCoroutines +// !API_VERSION: 1.3 // IGNORE_BACKEND: JS, JS_IR -// COMMON_COROUTINES_TEST +// IGNORE_BACKEND: JVM_IR // WITH_COROUTINES import helpers.* -import COROUTINES_PACKAGE.* -import COROUTINES_PACKAGE.intrinsics.* +import kotlin.coroutines.* +import kotlin.coroutines.intrinsics.* suspend inline fun Long.longArgs(a: Long, b: Long, c: Long) = suspendCoroutineUninterceptedOrReturn { it.resume(this + a + b + c) diff --git a/compiler/testData/codegen/box/coroutines/localCallableRef.kt b/compiler/testData/codegen/box/coroutines/localCallableRef.kt index 86d7f45086c..5135b93230b 100644 --- a/compiler/testData/codegen/box/coroutines/localCallableRef.kt +++ b/compiler/testData/codegen/box/coroutines/localCallableRef.kt @@ -2,10 +2,10 @@ // IGNORE_BACKEND: JVM_IR // WITH_RUNTIME // WITH_COROUTINES -// COMMON_COROUTINES_TEST +// LANGUAGE_VERSION: 1.3 import helpers.* -import COROUTINES_PACKAGE.* -import COROUTINES_PACKAGE.intrinsics.* +import kotlin.coroutines.* +import kotlin.coroutines.intrinsics.* suspend fun suspendWithValue(result: () -> String): String = suspendCoroutineUninterceptedOrReturn { x -> x.resume(result()) diff --git a/compiler/testData/codegen/box/reflection/modifiers/functions.kt b/compiler/testData/codegen/box/reflection/modifiers/functions.kt index 727ac14001e..f82fa0424a3 100644 --- a/compiler/testData/codegen/box/reflection/modifiers/functions.kt +++ b/compiler/testData/codegen/box/reflection/modifiers/functions.kt @@ -1,3 +1,5 @@ +// !LANGUAGE: +ReleaseCoroutines +// !API_VERSION: 1.3 // IGNORE_BACKEND: JVM_IR // IGNORE_BACKEND: JS_IR // TODO: muted automatically, investigate should it be ran for JS or not diff --git a/compiler/testData/codegen/boxInline/suspend/callableReference/simple.kt b/compiler/testData/codegen/boxInline/suspend/callableReference/simple.kt index 2f424c97828..f7f85e4c345 100644 --- a/compiler/testData/codegen/boxInline/suspend/callableReference/simple.kt +++ b/compiler/testData/codegen/boxInline/suspend/callableReference/simple.kt @@ -1,18 +1,18 @@ -// IGNORE_BACKEND: JVM_IR +// !LANGUAGE: +ReleaseCoroutines +// !API_VERSION: 1.3 // IGNORE_BACKEND: JS, JS_IR +// IGNORE_BACKEND: JVM_IR // NO_CHECK_LAMBDA_INLINING // FILE: test.kt -// COMMON_COROUTINES_TEST inline suspend fun foo(x: suspend () -> String) = x() // FILE: box.kt // WITH_RUNTIME // WITH_COROUTINES -// COMMON_COROUTINES_TEST -import COROUTINES_PACKAGE.* -import COROUTINES_PACKAGE.intrinsics.* +import kotlin.coroutines.* +import kotlin.coroutines.intrinsics.* fun builder(c: suspend () -> Unit) { c.startCoroutine(object: helpers.ContinuationAdapter() { diff --git a/compiler/testData/diagnostics/tests/coroutines/callableReference/outsideSuspend.kt b/compiler/testData/diagnostics/tests/coroutines/callableReference/outsideSuspend.kt index 7192f4b1f5a..2352c576911 100644 --- a/compiler/testData/diagnostics/tests/coroutines/callableReference/outsideSuspend.kt +++ b/compiler/testData/diagnostics/tests/coroutines/callableReference/outsideSuspend.kt @@ -1,5 +1,6 @@ // !CHECK_TYPE -// !LANGUAGE: +Coroutines +// !LANGUAGE: +ReleaseCoroutines +// !API_VERSION: 1.3 // SKIP_TXT import kotlin.reflect.KSuspendFunction0 diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/callableReferences.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/callableReferences.kt index 244f1ad7d2c..8786f13dfaf 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/callableReferences.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/callableReferences.kt @@ -1,3 +1,5 @@ +// !LANGUAGE: +ReleaseCoroutines +// !API_VERSION: 1.3 // !DIAGNOSTICS: -UNUSED_VARIABLE suspend fun foo() {} diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/modifierFormForNonBuiltInSuspend.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/modifierFormForNonBuiltInSuspend.kt index 48689a0de6a..239707bbed5 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/modifierFormForNonBuiltInSuspend.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/modifierFormForNonBuiltInSuspend.kt @@ -1,3 +1,5 @@ +// !LANGUAGE: +ReleaseCoroutines +// !API_VERSION: 1.3 // SKIP_TXT fun suspend(block: suspend () -> R): suspend () -> R = block diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/modifierFormForNonBuiltInSuspendWithAnyParameter.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/modifierFormForNonBuiltInSuspendWithAnyParameter.kt index 4ffdaaf5cba..9712d9cfe45 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/modifierFormForNonBuiltInSuspendWithAnyParameter.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/modifierFormForNonBuiltInSuspendWithAnyParameter.kt @@ -1,3 +1,5 @@ +// !LANGUAGE: +ReleaseCoroutines +// !API_VERSION: 1.3 // SKIP_TXT fun suspend(block: R) = block diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/nonModifierFormForBuiltIn.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/nonModifierFormForBuiltIn.kt index ab5033e663a..34019060d2d 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/nonModifierFormForBuiltIn.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/nonModifierFormForBuiltIn.kt @@ -1,3 +1,5 @@ +// !LANGUAGE: +ReleaseCoroutines +// !API_VERSION: 1.3 // SKIP_TXT fun bar() { suspend { diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/nonModifierFormForBuiltInRenameOnImport.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/nonModifierFormForBuiltInRenameOnImport.kt index 93d92a35662..62433d37ee2 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/nonModifierFormForBuiltInRenameOnImport.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/nonModifierFormForBuiltInRenameOnImport.kt @@ -1,3 +1,5 @@ +// !LANGUAGE: +ReleaseCoroutines +// !API_VERSION: 1.3 // SKIP_TXT import kotlin.suspend as suspendLambda diff --git a/compiler/tests-common/tests/org/jetbrains/kotlin/test/KotlinTestUtils.java b/compiler/tests-common/tests/org/jetbrains/kotlin/test/KotlinTestUtils.java index 9a5ce4a6d4c..ffc97caa4b4 100644 --- a/compiler/tests-common/tests/org/jetbrains/kotlin/test/KotlinTestUtils.java +++ b/compiler/tests-common/tests/org/jetbrains/kotlin/test/KotlinTestUtils.java @@ -789,7 +789,8 @@ public class KotlinTestUtils { boolean isReleaseCoroutines = !coroutinesPackage.contains("experimental") || - isDirectiveDefined(expectedText, "LANGUAGE_VERSION: 1.3"); + isDirectiveDefined(expectedText, "LANGUAGE_VERSION: 1.3") || + isDirectiveDefined(expectedText, "!LANGUAGE: +ReleaseCoroutines"); testFiles.add(factory.createFile(supportModule, "CoroutineUtil.kt", diff --git a/compiler/tests-ir-jvm/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java b/compiler/tests-ir-jvm/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java index 66c25646fe7..d63a707689d 100644 --- a/compiler/tests-ir-jvm/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java +++ b/compiler/tests-ir-jvm/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java @@ -5748,13 +5748,8 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes } @TestMetadata("localCallableRef.kt") - public void testLocalCallableRef_1_2() throws Exception { - runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/localCallableRef.kt", "kotlin.coroutines.experimental"); - } - - @TestMetadata("localCallableRef.kt") - public void testLocalCallableRef_1_3() throws Exception { - runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/localCallableRef.kt", "kotlin.coroutines"); + public void testLocalCallableRef() throws Exception { + runTest("compiler/testData/codegen/box/coroutines/localCallableRef.kt"); } @TestMetadata("localDelegate.kt") @@ -6428,32 +6423,18 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } - private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { - KotlinTestUtils.runTest(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JVM_IR, testDataFilePath); - } - public void testAllFilesPresentInCallableReference() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM_IR, true); } @TestMetadata("fromJava.kt") - public void testFromJava_1_2() throws Exception { - runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/fromJava.kt", "kotlin.coroutines.experimental"); - } - - @TestMetadata("fromJava.kt") - public void testFromJava_1_3() throws Exception { - runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/fromJava.kt", "kotlin.coroutines"); + public void testFromJava() throws Exception { + runTest("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/fromJava.kt"); } @TestMetadata("longArgs.kt") - public void testLongArgs_1_2() throws Exception { - runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/longArgs.kt", "kotlin.coroutines.experimental"); - } - - @TestMetadata("longArgs.kt") - public void testLongArgs_1_3() throws Exception { - runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/longArgs.kt", "kotlin.coroutines"); + public void testLongArgs() throws Exception { + runTest("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/longArgs.kt"); } @TestMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound") @@ -6464,22 +6445,13 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } - private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { - KotlinTestUtils.runTest(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JVM_IR, testDataFilePath); - } - public void testAllFilesPresentInBound() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM_IR, true); } @TestMetadata("emptyLHS.kt") - public void testEmptyLHS_1_2() throws Exception { - runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/emptyLHS.kt", "kotlin.coroutines.experimental"); - } - - @TestMetadata("emptyLHS.kt") - public void testEmptyLHS_1_3() throws Exception { - runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/emptyLHS.kt", "kotlin.coroutines"); + public void testEmptyLHS() throws Exception { + runTest("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/emptyLHS.kt"); } } @@ -6491,32 +6463,18 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } - private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { - KotlinTestUtils.runTest(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JVM_IR, testDataFilePath); - } - public void testAllFilesPresentInFunction() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM_IR, true); } @TestMetadata("genericCallableReferenceArguments.kt") - public void testGenericCallableReferenceArguments_1_2() throws Exception { - runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/genericCallableReferenceArguments.kt", "kotlin.coroutines.experimental"); - } - - @TestMetadata("genericCallableReferenceArguments.kt") - public void testGenericCallableReferenceArguments_1_3() throws Exception { - runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/genericCallableReferenceArguments.kt", "kotlin.coroutines"); + public void testGenericCallableReferenceArguments() throws Exception { + runTest("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/genericCallableReferenceArguments.kt"); } @TestMetadata("genericCallableReferencesWithNullableTypes.kt") - public void testGenericCallableReferencesWithNullableTypes_1_2() throws Exception { - runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/genericCallableReferencesWithNullableTypes.kt", "kotlin.coroutines.experimental"); - } - - @TestMetadata("genericCallableReferencesWithNullableTypes.kt") - public void testGenericCallableReferencesWithNullableTypes_1_3() throws Exception { - runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/genericCallableReferencesWithNullableTypes.kt", "kotlin.coroutines"); + public void testGenericCallableReferencesWithNullableTypes() throws Exception { + runTest("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/genericCallableReferencesWithNullableTypes.kt"); } @TestMetadata("getArityViaFunctionImpl.kt") @@ -6532,22 +6490,13 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } - private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { - KotlinTestUtils.runTest(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JVM_IR, testDataFilePath); - } - public void testAllFilesPresentInLocal() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM_IR, true); } @TestMetadata("equalsHashCode.kt") - public void testEqualsHashCode_1_2() throws Exception { - runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/equalsHashCode.kt", "kotlin.coroutines.experimental"); - } - - @TestMetadata("equalsHashCode.kt") - public void testEqualsHashCode_1_3() throws Exception { - runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/equalsHashCode.kt", "kotlin.coroutines"); + public void testEqualsHashCode() throws Exception { + runTest("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/equalsHashCode.kt"); } } } diff --git a/compiler/tests-ir-jvm/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxInlineCodegenTestGenerated.java b/compiler/tests-ir-jvm/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxInlineCodegenTestGenerated.java index 73f81e0c895..5318cf36a61 100644 --- a/compiler/tests-ir-jvm/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxInlineCodegenTestGenerated.java +++ b/compiler/tests-ir-jvm/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxInlineCodegenTestGenerated.java @@ -3367,10 +3367,6 @@ public class IrBlackBoxInlineCodegenTestGenerated extends AbstractIrBlackBoxInli KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } - private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { - KotlinTestUtils.runTest(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JVM_IR, testDataFilePath); - } - public void testAllFilesPresentInCallableReference() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxInline/suspend/callableReference"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM_IR, true); } @@ -3381,13 +3377,8 @@ public class IrBlackBoxInlineCodegenTestGenerated extends AbstractIrBlackBoxInli } @TestMetadata("simple.kt") - public void testSimple_1_2() throws Exception { - runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/callableReference/simple.kt", "kotlin.coroutines.experimental"); - } - - @TestMetadata("simple.kt") - public void testSimple_1_3() throws Exception { - runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/callableReference/simple.kt", "kotlin.coroutines"); + public void testSimple() throws Exception { + runTest("compiler/testData/codegen/boxInline/suspend/callableReference/simple.kt"); } @TestMetadata("suspendOfOrdinary.kt") diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java index 5185c498724..1768259a06f 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java @@ -5748,13 +5748,8 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { } @TestMetadata("localCallableRef.kt") - public void testLocalCallableRef_1_2() throws Exception { - runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/localCallableRef.kt", "kotlin.coroutines.experimental"); - } - - @TestMetadata("localCallableRef.kt") - public void testLocalCallableRef_1_3() throws Exception { - runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/localCallableRef.kt", "kotlin.coroutines"); + public void testLocalCallableRef() throws Exception { + runTest("compiler/testData/codegen/box/coroutines/localCallableRef.kt"); } @TestMetadata("localDelegate.kt") @@ -6428,32 +6423,18 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } - private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { - KotlinTestUtils.runTest(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JVM, testDataFilePath); - } - public void testAllFilesPresentInCallableReference() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); } @TestMetadata("fromJava.kt") - public void testFromJava_1_2() throws Exception { - runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/fromJava.kt", "kotlin.coroutines.experimental"); - } - - @TestMetadata("fromJava.kt") - public void testFromJava_1_3() throws Exception { - runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/fromJava.kt", "kotlin.coroutines"); + public void testFromJava() throws Exception { + runTest("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/fromJava.kt"); } @TestMetadata("longArgs.kt") - public void testLongArgs_1_2() throws Exception { - runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/longArgs.kt", "kotlin.coroutines.experimental"); - } - - @TestMetadata("longArgs.kt") - public void testLongArgs_1_3() throws Exception { - runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/longArgs.kt", "kotlin.coroutines"); + public void testLongArgs() throws Exception { + runTest("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/longArgs.kt"); } @TestMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound") @@ -6464,22 +6445,13 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } - private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { - KotlinTestUtils.runTest(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JVM, testDataFilePath); - } - public void testAllFilesPresentInBound() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); } @TestMetadata("emptyLHS.kt") - public void testEmptyLHS_1_2() throws Exception { - runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/emptyLHS.kt", "kotlin.coroutines.experimental"); - } - - @TestMetadata("emptyLHS.kt") - public void testEmptyLHS_1_3() throws Exception { - runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/emptyLHS.kt", "kotlin.coroutines"); + public void testEmptyLHS() throws Exception { + runTest("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/emptyLHS.kt"); } } @@ -6491,32 +6463,18 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } - private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { - KotlinTestUtils.runTest(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JVM, testDataFilePath); - } - public void testAllFilesPresentInFunction() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); } @TestMetadata("genericCallableReferenceArguments.kt") - public void testGenericCallableReferenceArguments_1_2() throws Exception { - runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/genericCallableReferenceArguments.kt", "kotlin.coroutines.experimental"); - } - - @TestMetadata("genericCallableReferenceArguments.kt") - public void testGenericCallableReferenceArguments_1_3() throws Exception { - runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/genericCallableReferenceArguments.kt", "kotlin.coroutines"); + public void testGenericCallableReferenceArguments() throws Exception { + runTest("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/genericCallableReferenceArguments.kt"); } @TestMetadata("genericCallableReferencesWithNullableTypes.kt") - public void testGenericCallableReferencesWithNullableTypes_1_2() throws Exception { - runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/genericCallableReferencesWithNullableTypes.kt", "kotlin.coroutines.experimental"); - } - - @TestMetadata("genericCallableReferencesWithNullableTypes.kt") - public void testGenericCallableReferencesWithNullableTypes_1_3() throws Exception { - runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/genericCallableReferencesWithNullableTypes.kt", "kotlin.coroutines"); + public void testGenericCallableReferencesWithNullableTypes() throws Exception { + runTest("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/genericCallableReferencesWithNullableTypes.kt"); } @TestMetadata("getArityViaFunctionImpl.kt") @@ -6532,22 +6490,13 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } - private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { - KotlinTestUtils.runTest(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JVM, testDataFilePath); - } - public void testAllFilesPresentInLocal() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); } @TestMetadata("equalsHashCode.kt") - public void testEqualsHashCode_1_2() throws Exception { - runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/equalsHashCode.kt", "kotlin.coroutines.experimental"); - } - - @TestMetadata("equalsHashCode.kt") - public void testEqualsHashCode_1_3() throws Exception { - runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/equalsHashCode.kt", "kotlin.coroutines"); + public void testEqualsHashCode() throws Exception { + runTest("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/equalsHashCode.kt"); } } } diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxInlineCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxInlineCodegenTestGenerated.java index 60bb133d4cc..f5e93c63b5b 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxInlineCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxInlineCodegenTestGenerated.java @@ -3367,10 +3367,6 @@ public class BlackBoxInlineCodegenTestGenerated extends AbstractBlackBoxInlineCo KotlinTestUtils.runTest(this::doTest, TargetBackend.ANY, testDataFilePath); } - private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { - KotlinTestUtils.runTest(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.ANY, testDataFilePath); - } - public void testAllFilesPresentInCallableReference() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxInline/suspend/callableReference"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); } @@ -3381,13 +3377,8 @@ public class BlackBoxInlineCodegenTestGenerated extends AbstractBlackBoxInlineCo } @TestMetadata("simple.kt") - public void testSimple_1_2() throws Exception { - runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/callableReference/simple.kt", "kotlin.coroutines.experimental"); - } - - @TestMetadata("simple.kt") - public void testSimple_1_3() throws Exception { - runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/callableReference/simple.kt", "kotlin.coroutines"); + public void testSimple() throws Exception { + runTest("compiler/testData/codegen/boxInline/suspend/callableReference/simple.kt"); } @TestMetadata("suspendOfOrdinary.kt") diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/CompileKotlinAgainstInlineKotlinTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/CompileKotlinAgainstInlineKotlinTestGenerated.java index 9a989d9c5ac..a5a2c30a7b4 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/CompileKotlinAgainstInlineKotlinTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/CompileKotlinAgainstInlineKotlinTestGenerated.java @@ -3367,10 +3367,6 @@ public class CompileKotlinAgainstInlineKotlinTestGenerated extends AbstractCompi KotlinTestUtils.runTest(this::doTest, TargetBackend.ANY, testDataFilePath); } - private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { - KotlinTestUtils.runTest(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.ANY, testDataFilePath); - } - public void testAllFilesPresentInCallableReference() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxInline/suspend/callableReference"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); } @@ -3381,13 +3377,8 @@ public class CompileKotlinAgainstInlineKotlinTestGenerated extends AbstractCompi } @TestMetadata("simple.kt") - public void testSimple_1_2() throws Exception { - runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/callableReference/simple.kt", "kotlin.coroutines.experimental"); - } - - @TestMetadata("simple.kt") - public void testSimple_1_3() throws Exception { - runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/callableReference/simple.kt", "kotlin.coroutines"); + public void testSimple() throws Exception { + runTest("compiler/testData/codegen/boxInline/suspend/callableReference/simple.kt"); } @TestMetadata("suspendOfOrdinary.kt") diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java index 403f561414d..0e34106fe51 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java @@ -5748,13 +5748,8 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes } @TestMetadata("localCallableRef.kt") - public void testLocalCallableRef_1_2() throws Exception { - runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/localCallableRef.kt", "kotlin.coroutines.experimental"); - } - - @TestMetadata("localCallableRef.kt") - public void testLocalCallableRef_1_3() throws Exception { - runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/localCallableRef.kt", "kotlin.coroutines"); + public void testLocalCallableRef() throws Exception { + runTest("compiler/testData/codegen/box/coroutines/localCallableRef.kt"); } @TestMetadata("localDelegate.kt") @@ -6428,32 +6423,18 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } - private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { - KotlinTestUtils.runTest(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JVM, testDataFilePath); - } - public void testAllFilesPresentInCallableReference() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); } @TestMetadata("fromJava.kt") - public void testFromJava_1_2() throws Exception { - runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/fromJava.kt", "kotlin.coroutines.experimental"); - } - - @TestMetadata("fromJava.kt") - public void testFromJava_1_3() throws Exception { - runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/fromJava.kt", "kotlin.coroutines"); + public void testFromJava() throws Exception { + runTest("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/fromJava.kt"); } @TestMetadata("longArgs.kt") - public void testLongArgs_1_2() throws Exception { - runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/longArgs.kt", "kotlin.coroutines.experimental"); - } - - @TestMetadata("longArgs.kt") - public void testLongArgs_1_3() throws Exception { - runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/longArgs.kt", "kotlin.coroutines"); + public void testLongArgs() throws Exception { + runTest("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/longArgs.kt"); } @TestMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound") @@ -6464,22 +6445,13 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } - private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { - KotlinTestUtils.runTest(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JVM, testDataFilePath); - } - public void testAllFilesPresentInBound() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); } @TestMetadata("emptyLHS.kt") - public void testEmptyLHS_1_2() throws Exception { - runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/emptyLHS.kt", "kotlin.coroutines.experimental"); - } - - @TestMetadata("emptyLHS.kt") - public void testEmptyLHS_1_3() throws Exception { - runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/emptyLHS.kt", "kotlin.coroutines"); + public void testEmptyLHS() throws Exception { + runTest("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/emptyLHS.kt"); } } @@ -6491,32 +6463,18 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } - private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { - KotlinTestUtils.runTest(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JVM, testDataFilePath); - } - public void testAllFilesPresentInFunction() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); } @TestMetadata("genericCallableReferenceArguments.kt") - public void testGenericCallableReferenceArguments_1_2() throws Exception { - runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/genericCallableReferenceArguments.kt", "kotlin.coroutines.experimental"); - } - - @TestMetadata("genericCallableReferenceArguments.kt") - public void testGenericCallableReferenceArguments_1_3() throws Exception { - runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/genericCallableReferenceArguments.kt", "kotlin.coroutines"); + public void testGenericCallableReferenceArguments() throws Exception { + runTest("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/genericCallableReferenceArguments.kt"); } @TestMetadata("genericCallableReferencesWithNullableTypes.kt") - public void testGenericCallableReferencesWithNullableTypes_1_2() throws Exception { - runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/genericCallableReferencesWithNullableTypes.kt", "kotlin.coroutines.experimental"); - } - - @TestMetadata("genericCallableReferencesWithNullableTypes.kt") - public void testGenericCallableReferencesWithNullableTypes_1_3() throws Exception { - runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/genericCallableReferencesWithNullableTypes.kt", "kotlin.coroutines"); + public void testGenericCallableReferencesWithNullableTypes() throws Exception { + runTest("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/genericCallableReferencesWithNullableTypes.kt"); } @TestMetadata("getArityViaFunctionImpl.kt") @@ -6532,22 +6490,13 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } - private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { - KotlinTestUtils.runTest(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JVM, testDataFilePath); - } - public void testAllFilesPresentInLocal() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true); } @TestMetadata("equalsHashCode.kt") - public void testEqualsHashCode_1_2() throws Exception { - runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/equalsHashCode.kt", "kotlin.coroutines.experimental"); - } - - @TestMetadata("equalsHashCode.kt") - public void testEqualsHashCode_1_3() throws Exception { - runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/equalsHashCode.kt", "kotlin.coroutines"); + public void testEqualsHashCode() throws Exception { + runTest("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/equalsHashCode.kt"); } } } diff --git a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/InlineSuspendTestsGenerated.java b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/InlineSuspendTestsGenerated.java index 9b987c61eba..851d0933170 100644 --- a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/InlineSuspendTestsGenerated.java +++ b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/InlineSuspendTestsGenerated.java @@ -181,10 +181,6 @@ public class InlineSuspendTestsGenerated extends AbstractInlineSuspendTests { KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS, testDataFilePath); } - private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { - KotlinTestUtils.runTest0(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JS, testDataFilePath); - } - public void testAllFilesPresentInCallableReference() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxInline/suspend/callableReference"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS, true); } @@ -195,13 +191,8 @@ public class InlineSuspendTestsGenerated extends AbstractInlineSuspendTests { } @TestMetadata("simple.kt") - public void testSimple_1_2() throws Exception { - runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/callableReference/simple.kt", "kotlin.coroutines.experimental"); - } - - @TestMetadata("simple.kt") - public void testSimple_1_3() throws Exception { - runTestWithPackageReplacement("compiler/testData/codegen/boxInline/suspend/callableReference/simple.kt", "kotlin.coroutines"); + public void testSimple() throws Exception { + runTest("compiler/testData/codegen/boxInline/suspend/callableReference/simple.kt"); } @TestMetadata("suspendOfOrdinary.kt") diff --git a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/IrJsCodegenBoxTestGenerated.java b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/IrJsCodegenBoxTestGenerated.java index 368d2a56b42..a4208fc62f2 100644 --- a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/IrJsCodegenBoxTestGenerated.java +++ b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/IrJsCodegenBoxTestGenerated.java @@ -5258,8 +5258,8 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { } @TestMetadata("localCallableRef.kt") - public void testLocalCallableRef_1_2() throws Exception { - runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/localCallableRef.kt", "kotlin.coroutines.experimental"); + public void testLocalCallableRef() throws Exception { + runTest("compiler/testData/codegen/box/coroutines/localCallableRef.kt"); } @TestMetadata("localDelegate.kt") @@ -5608,22 +5608,18 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR, testDataFilePath); } - private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { - KotlinTestUtils.runTest0(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JS_IR, testDataFilePath); - } - public void testAllFilesPresentInCallableReference() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS_IR, true); } @TestMetadata("fromJava.kt") - public void testFromJava_1_2() throws Exception { - runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/fromJava.kt", "kotlin.coroutines.experimental"); + public void testFromJava() throws Exception { + runTest("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/fromJava.kt"); } @TestMetadata("longArgs.kt") - public void testLongArgs_1_2() throws Exception { - runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/longArgs.kt", "kotlin.coroutines.experimental"); + public void testLongArgs() throws Exception { + runTest("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/longArgs.kt"); } @TestMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound") @@ -5634,17 +5630,13 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR, testDataFilePath); } - private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { - KotlinTestUtils.runTest0(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JS_IR, testDataFilePath); - } - public void testAllFilesPresentInBound() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS_IR, true); } @TestMetadata("emptyLHS.kt") - public void testEmptyLHS_1_2() throws Exception { - runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/emptyLHS.kt", "kotlin.coroutines.experimental"); + public void testEmptyLHS() throws Exception { + runTest("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/emptyLHS.kt"); } } @@ -5656,22 +5648,18 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR, testDataFilePath); } - private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { - KotlinTestUtils.runTest0(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JS_IR, testDataFilePath); - } - public void testAllFilesPresentInFunction() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS_IR, true); } @TestMetadata("genericCallableReferenceArguments.kt") - public void testGenericCallableReferenceArguments_1_2() throws Exception { - runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/genericCallableReferenceArguments.kt", "kotlin.coroutines.experimental"); + public void testGenericCallableReferenceArguments() throws Exception { + runTest("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/genericCallableReferenceArguments.kt"); } @TestMetadata("genericCallableReferencesWithNullableTypes.kt") - public void testGenericCallableReferencesWithNullableTypes_1_2() throws Exception { - runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/genericCallableReferencesWithNullableTypes.kt", "kotlin.coroutines.experimental"); + public void testGenericCallableReferencesWithNullableTypes() throws Exception { + runTest("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/genericCallableReferencesWithNullableTypes.kt"); } @TestMetadata("getArityViaFunctionImpl.kt") @@ -5687,17 +5675,13 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR, testDataFilePath); } - private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { - KotlinTestUtils.runTest0(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JS_IR, testDataFilePath); - } - public void testAllFilesPresentInLocal() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS_IR, true); } @TestMetadata("equalsHashCode.kt") - public void testEqualsHashCode_1_2() throws Exception { - runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/equalsHashCode.kt", "kotlin.coroutines.experimental"); + public void testEqualsHashCode() throws Exception { + runTest("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/equalsHashCode.kt"); } } } diff --git a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java index 51cc1276e39..d074f69d1bd 100644 --- a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java +++ b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java @@ -5488,13 +5488,8 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { } @TestMetadata("localCallableRef.kt") - public void testLocalCallableRef_1_2() throws Exception { - runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/localCallableRef.kt", "kotlin.coroutines.experimental"); - } - - @TestMetadata("localCallableRef.kt") - public void testLocalCallableRef_1_3() throws Exception { - runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/localCallableRef.kt", "kotlin.coroutines"); + public void testLocalCallableRef() throws Exception { + runTest("compiler/testData/codegen/box/coroutines/localCallableRef.kt"); } @TestMetadata("localDelegate.kt") @@ -6148,32 +6143,18 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS, testDataFilePath); } - private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { - KotlinTestUtils.runTest0(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JS, testDataFilePath); - } - public void testAllFilesPresentInCallableReference() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS, true); } @TestMetadata("fromJava.kt") - public void testFromJava_1_2() throws Exception { - runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/fromJava.kt", "kotlin.coroutines.experimental"); - } - - @TestMetadata("fromJava.kt") - public void testFromJava_1_3() throws Exception { - runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/fromJava.kt", "kotlin.coroutines"); + public void testFromJava() throws Exception { + runTest("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/fromJava.kt"); } @TestMetadata("longArgs.kt") - public void testLongArgs_1_2() throws Exception { - runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/longArgs.kt", "kotlin.coroutines.experimental"); - } - - @TestMetadata("longArgs.kt") - public void testLongArgs_1_3() throws Exception { - runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/longArgs.kt", "kotlin.coroutines"); + public void testLongArgs() throws Exception { + runTest("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/longArgs.kt"); } @TestMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound") @@ -6184,22 +6165,13 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS, testDataFilePath); } - private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { - KotlinTestUtils.runTest0(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JS, testDataFilePath); - } - public void testAllFilesPresentInBound() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS, true); } @TestMetadata("emptyLHS.kt") - public void testEmptyLHS_1_2() throws Exception { - runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/emptyLHS.kt", "kotlin.coroutines.experimental"); - } - - @TestMetadata("emptyLHS.kt") - public void testEmptyLHS_1_3() throws Exception { - runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/emptyLHS.kt", "kotlin.coroutines"); + public void testEmptyLHS() throws Exception { + runTest("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/bound/emptyLHS.kt"); } } @@ -6211,32 +6183,18 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS, testDataFilePath); } - private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { - KotlinTestUtils.runTest0(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JS, testDataFilePath); - } - public void testAllFilesPresentInFunction() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS, true); } @TestMetadata("genericCallableReferenceArguments.kt") - public void testGenericCallableReferenceArguments_1_2() throws Exception { - runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/genericCallableReferenceArguments.kt", "kotlin.coroutines.experimental"); - } - - @TestMetadata("genericCallableReferenceArguments.kt") - public void testGenericCallableReferenceArguments_1_3() throws Exception { - runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/genericCallableReferenceArguments.kt", "kotlin.coroutines"); + public void testGenericCallableReferenceArguments() throws Exception { + runTest("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/genericCallableReferenceArguments.kt"); } @TestMetadata("genericCallableReferencesWithNullableTypes.kt") - public void testGenericCallableReferencesWithNullableTypes_1_2() throws Exception { - runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/genericCallableReferencesWithNullableTypes.kt", "kotlin.coroutines.experimental"); - } - - @TestMetadata("genericCallableReferencesWithNullableTypes.kt") - public void testGenericCallableReferencesWithNullableTypes_1_3() throws Exception { - runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/genericCallableReferencesWithNullableTypes.kt", "kotlin.coroutines"); + public void testGenericCallableReferencesWithNullableTypes() throws Exception { + runTest("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/genericCallableReferencesWithNullableTypes.kt"); } @TestMetadata("getArityViaFunctionImpl.kt") @@ -6252,22 +6210,13 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS, testDataFilePath); } - private void runTestWithPackageReplacement(String testDataFilePath, String packageName) throws Exception { - KotlinTestUtils.runTest0(filePath -> doTestWithCoroutinesPackageReplacement(filePath, packageName), TargetBackend.JS, testDataFilePath); - } - public void testAllFilesPresentInLocal() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS, true); } @TestMetadata("equalsHashCode.kt") - public void testEqualsHashCode_1_2() throws Exception { - runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/equalsHashCode.kt", "kotlin.coroutines.experimental"); - } - - @TestMetadata("equalsHashCode.kt") - public void testEqualsHashCode_1_3() throws Exception { - runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/equalsHashCode.kt", "kotlin.coroutines"); + public void testEqualsHashCode() throws Exception { + runTest("compiler/testData/codegen/box/coroutines/featureIntersection/callableReference/function/local/equalsHashCode.kt"); } } }