[NI] Remove failing codegen tests and add similar diagnostic one
These tests were added for suspend-conversions, it worked only
with new inference, but implementation was incorrect and had other
bugs, which were fixed in 1ac25259.
Support of suspend-conversions will be addressed later with a different
implementation (#KT-30703)
This commit is contained in:
-38
@@ -1,38 +0,0 @@
|
|||||||
// !LANGUAGE: +NewInference
|
|
||||||
// IGNORE_BACKEND: NATIVE
|
|
||||||
// IGNORE_BACKEND: JVM_IR
|
|
||||||
// IGNORE_BACKEND: JS
|
|
||||||
// NO_CHECK_LAMBDA_INLINING
|
|
||||||
// FILE: test.kt
|
|
||||||
// We cannot use COMMON_COROUTINES_TEST here due to !LANGUAGE directive
|
|
||||||
// TODO: Fix this
|
|
||||||
|
|
||||||
inline fun go(f: () -> String) = f()
|
|
||||||
|
|
||||||
// FILE: box.kt
|
|
||||||
// WITH_RUNTIME
|
|
||||||
|
|
||||||
import kotlin.coroutines.*
|
|
||||||
import kotlin.coroutines.intrinsics.*
|
|
||||||
|
|
||||||
fun builder(c: suspend () -> Unit) {
|
|
||||||
c.startCoroutine(object: Continuation<Unit> {
|
|
||||||
override val context: CoroutineContext
|
|
||||||
get() = EmptyCoroutineContext
|
|
||||||
|
|
||||||
override fun resumeWith(result: Result<Unit>) {
|
|
||||||
result.getOrThrow()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
suspend fun String.id(): String = this
|
|
||||||
|
|
||||||
fun box(): String {
|
|
||||||
val x = "OK"
|
|
||||||
var res = "FAIL"
|
|
||||||
builder {
|
|
||||||
res = go(x::id)
|
|
||||||
}
|
|
||||||
return res
|
|
||||||
}
|
|
||||||
-36
@@ -1,36 +0,0 @@
|
|||||||
// !LANGUAGE: +NewInference
|
|
||||||
// IGNORE_BACKEND: NATIVE
|
|
||||||
// IGNORE_BACKEND: JVM_IR
|
|
||||||
// IGNORE_BACKEND: JS
|
|
||||||
// NO_CHECK_LAMBDA_INLINING
|
|
||||||
// FILE: test.kt
|
|
||||||
|
|
||||||
inline suspend fun go(f: () -> String) = f()
|
|
||||||
|
|
||||||
// FILE: box.kt
|
|
||||||
// WITH_RUNTIME
|
|
||||||
|
|
||||||
import kotlin.coroutines.*
|
|
||||||
import kotlin.coroutines.intrinsics.*
|
|
||||||
|
|
||||||
fun builder(c: suspend () -> Unit) {
|
|
||||||
c.startCoroutine(object: Continuation<Unit> {
|
|
||||||
override val context: CoroutineContext
|
|
||||||
get() = EmptyCoroutineContext
|
|
||||||
|
|
||||||
override fun resumeWith(result: Result<Unit>) {
|
|
||||||
result.getOrThrow()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
suspend fun String.id(): String = this
|
|
||||||
|
|
||||||
fun box(): String {
|
|
||||||
val x = "OK"
|
|
||||||
var res = "FAIL"
|
|
||||||
builder {
|
|
||||||
res = go(x::id)
|
|
||||||
}
|
|
||||||
return res
|
|
||||||
}
|
|
||||||
+17
@@ -0,0 +1,17 @@
|
|||||||
|
// !LANGUAGE: +NewInference
|
||||||
|
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||||
|
|
||||||
|
inline fun go1(f: () -> String) = f()
|
||||||
|
inline suspend fun go2(f: () -> String) = f()
|
||||||
|
|
||||||
|
fun builder(c: suspend () -> Unit) {}
|
||||||
|
|
||||||
|
suspend fun String.id(): String = this
|
||||||
|
|
||||||
|
fun box() {
|
||||||
|
val x = "f"
|
||||||
|
builder {
|
||||||
|
go1(<!TYPE_MISMATCH!>x::id<!>)
|
||||||
|
go2(<!TYPE_MISMATCH!>x::id<!>)
|
||||||
|
}
|
||||||
|
}
|
||||||
+7
@@ -0,0 +1,7 @@
|
|||||||
|
package
|
||||||
|
|
||||||
|
public fun box(): kotlin.Unit
|
||||||
|
public fun builder(/*0*/ c: suspend () -> kotlin.Unit): kotlin.Unit
|
||||||
|
public inline fun go1(/*0*/ f: () -> kotlin.String): kotlin.String
|
||||||
|
public suspend inline fun go2(/*0*/ f: () -> kotlin.String): kotlin.String
|
||||||
|
public suspend fun kotlin.String.id(): kotlin.String
|
||||||
+5
@@ -1783,6 +1783,11 @@ public class DiagnosticsTestWithStdLibGenerated extends AbstractDiagnosticsTestW
|
|||||||
public void testProperty_1_3() throws Exception {
|
public void testProperty_1_3() throws Exception {
|
||||||
runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/callableReference/property.kt", "kotlin.coroutines");
|
runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/callableReference/property.kt", "kotlin.coroutines");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("suspendConversionForCallableReferences.kt")
|
||||||
|
public void testSuspendConversionForCallableReferences() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/testsWithStdLib/coroutines/callableReference/suspendConversionForCallableReferences.kt");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/inference")
|
@TestMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/inference")
|
||||||
|
|||||||
compiler/tests/org/jetbrains/kotlin/checkers/javac/DiagnosticsTestWithStdLibUsingJavacGenerated.java
Generated
+5
@@ -1783,6 +1783,11 @@ public class DiagnosticsTestWithStdLibUsingJavacGenerated extends AbstractDiagno
|
|||||||
public void testProperty_1_3() throws Exception {
|
public void testProperty_1_3() throws Exception {
|
||||||
runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/callableReference/property.kt", "kotlin.coroutines");
|
runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/callableReference/property.kt", "kotlin.coroutines");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("suspendConversionForCallableReferences.kt")
|
||||||
|
public void testSuspendConversionForCallableReferences() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/testsWithStdLib/coroutines/callableReference/suspendConversionForCallableReferences.kt");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/inference")
|
@TestMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/inference")
|
||||||
|
|||||||
-10
@@ -3587,20 +3587,10 @@ public class BlackBoxInlineCodegenTestGenerated extends AbstractBlackBoxInlineCo
|
|||||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxInline/suspend/callableReference"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true);
|
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxInline/suspend/callableReference"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("ordinaryParameter.kt")
|
|
||||||
public void testOrdinaryParameter() throws Exception {
|
|
||||||
runTest("compiler/testData/codegen/boxInline/suspend/callableReference/ordinaryParameter.kt");
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("simple.kt")
|
@TestMetadata("simple.kt")
|
||||||
public void testSimple() throws Exception {
|
public void testSimple() throws Exception {
|
||||||
runTest("compiler/testData/codegen/boxInline/suspend/callableReference/simple.kt");
|
runTest("compiler/testData/codegen/boxInline/suspend/callableReference/simple.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("suspendOfOrdinary.kt")
|
|
||||||
public void testSuspendOfOrdinary() throws Exception {
|
|
||||||
runTest("compiler/testData/codegen/boxInline/suspend/callableReference/suspendOfOrdinary.kt");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("compiler/testData/codegen/boxInline/suspend/defaultParameter")
|
@TestMetadata("compiler/testData/codegen/boxInline/suspend/defaultParameter")
|
||||||
|
|||||||
Generated
-10
@@ -3587,20 +3587,10 @@ public class CompileKotlinAgainstInlineKotlinTestGenerated extends AbstractCompi
|
|||||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxInline/suspend/callableReference"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true);
|
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxInline/suspend/callableReference"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("ordinaryParameter.kt")
|
|
||||||
public void testOrdinaryParameter() throws Exception {
|
|
||||||
runTest("compiler/testData/codegen/boxInline/suspend/callableReference/ordinaryParameter.kt");
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("simple.kt")
|
@TestMetadata("simple.kt")
|
||||||
public void testSimple() throws Exception {
|
public void testSimple() throws Exception {
|
||||||
runTest("compiler/testData/codegen/boxInline/suspend/callableReference/simple.kt");
|
runTest("compiler/testData/codegen/boxInline/suspend/callableReference/simple.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("suspendOfOrdinary.kt")
|
|
||||||
public void testSuspendOfOrdinary() throws Exception {
|
|
||||||
runTest("compiler/testData/codegen/boxInline/suspend/callableReference/suspendOfOrdinary.kt");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("compiler/testData/codegen/boxInline/suspend/defaultParameter")
|
@TestMetadata("compiler/testData/codegen/boxInline/suspend/defaultParameter")
|
||||||
|
|||||||
-10
@@ -3587,20 +3587,10 @@ public class IrBlackBoxInlineCodegenTestGenerated extends AbstractIrBlackBoxInli
|
|||||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxInline/suspend/callableReference"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM_IR, true);
|
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxInline/suspend/callableReference"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM_IR, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("ordinaryParameter.kt")
|
|
||||||
public void testOrdinaryParameter() throws Exception {
|
|
||||||
runTest("compiler/testData/codegen/boxInline/suspend/callableReference/ordinaryParameter.kt");
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("simple.kt")
|
@TestMetadata("simple.kt")
|
||||||
public void testSimple() throws Exception {
|
public void testSimple() throws Exception {
|
||||||
runTest("compiler/testData/codegen/boxInline/suspend/callableReference/simple.kt");
|
runTest("compiler/testData/codegen/boxInline/suspend/callableReference/simple.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("suspendOfOrdinary.kt")
|
|
||||||
public void testSuspendOfOrdinary() throws Exception {
|
|
||||||
runTest("compiler/testData/codegen/boxInline/suspend/callableReference/suspendOfOrdinary.kt");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("compiler/testData/codegen/boxInline/suspend/defaultParameter")
|
@TestMetadata("compiler/testData/codegen/boxInline/suspend/defaultParameter")
|
||||||
|
|||||||
Generated
-10
@@ -125,20 +125,10 @@ public class IrInlineSuspendTestsGenerated extends AbstractIrInlineSuspendTests
|
|||||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxInline/suspend/callableReference"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS_IR, true);
|
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxInline/suspend/callableReference"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS_IR, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("ordinaryParameter.kt")
|
|
||||||
public void testOrdinaryParameter() throws Exception {
|
|
||||||
runTest("compiler/testData/codegen/boxInline/suspend/callableReference/ordinaryParameter.kt");
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("simple.kt")
|
@TestMetadata("simple.kt")
|
||||||
public void testSimple() throws Exception {
|
public void testSimple() throws Exception {
|
||||||
runTest("compiler/testData/codegen/boxInline/suspend/callableReference/simple.kt");
|
runTest("compiler/testData/codegen/boxInline/suspend/callableReference/simple.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("suspendOfOrdinary.kt")
|
|
||||||
public void testSuspendOfOrdinary() throws Exception {
|
|
||||||
runTest("compiler/testData/codegen/boxInline/suspend/callableReference/suspendOfOrdinary.kt");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("compiler/testData/codegen/boxInline/suspend/defaultParameter")
|
@TestMetadata("compiler/testData/codegen/boxInline/suspend/defaultParameter")
|
||||||
|
|||||||
-10
@@ -200,20 +200,10 @@ public class InlineSuspendTestsGenerated extends AbstractInlineSuspendTests {
|
|||||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxInline/suspend/callableReference"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS, true);
|
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxInline/suspend/callableReference"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("ordinaryParameter.kt")
|
|
||||||
public void testOrdinaryParameter() throws Exception {
|
|
||||||
runTest("compiler/testData/codegen/boxInline/suspend/callableReference/ordinaryParameter.kt");
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("simple.kt")
|
@TestMetadata("simple.kt")
|
||||||
public void testSimple() throws Exception {
|
public void testSimple() throws Exception {
|
||||||
runTest("compiler/testData/codegen/boxInline/suspend/callableReference/simple.kt");
|
runTest("compiler/testData/codegen/boxInline/suspend/callableReference/simple.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("suspendOfOrdinary.kt")
|
|
||||||
public void testSuspendOfOrdinary() throws Exception {
|
|
||||||
runTest("compiler/testData/codegen/boxInline/suspend/callableReference/suspendOfOrdinary.kt");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("compiler/testData/codegen/boxInline/suspend/defaultParameter")
|
@TestMetadata("compiler/testData/codegen/boxInline/suspend/defaultParameter")
|
||||||
|
|||||||
Reference in New Issue
Block a user