Add test for questionable chained fun -> suspend conversion
This commit is contained in:
+5
@@ -23021,6 +23021,11 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirOldFronte
|
||||
runTest("compiler/testData/diagnostics/tests/suspendConversion/basicSuspendConversionGenerics.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("chainedFunSuspendConversionForSimpleExpression.kt")
|
||||
public void testChainedFunSuspendConversionForSimpleExpression() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/suspendConversion/chainedFunSuspendConversionForSimpleExpression.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("severalConversionsInOneCall.kt")
|
||||
public void testSeveralConversionsInOneCall() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/suspendConversion/severalConversionsInOneCall.kt");
|
||||
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
// !LANGUAGE: +SuspendConversion
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
fun interface SuspendRunnable {
|
||||
suspend fun invoke()
|
||||
}
|
||||
|
||||
fun foo(s: SuspendRunnable) {}
|
||||
|
||||
fun test(f: () -> Unit) {
|
||||
foo { }
|
||||
<!INAPPLICABLE_CANDIDATE!>foo<!>(f)
|
||||
}
|
||||
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
// !LANGUAGE: +SuspendConversion
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
fun interface SuspendRunnable {
|
||||
suspend fun invoke()
|
||||
}
|
||||
|
||||
fun foo(s: SuspendRunnable) {}
|
||||
|
||||
fun test(f: () -> Unit) {
|
||||
foo { }
|
||||
foo(<!TYPE_MISMATCH!>f<!>)
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
package
|
||||
|
||||
public fun foo(/*0*/ s: SuspendRunnable): kotlin.Unit
|
||||
public fun test(/*0*/ f: () -> kotlin.Unit): kotlin.Unit
|
||||
|
||||
public fun interface SuspendRunnable {
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public abstract suspend fun invoke(): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
@@ -23103,6 +23103,11 @@ public class DiagnosticsTestGenerated extends AbstractDiagnosticsTestWithFirVali
|
||||
runTest("compiler/testData/diagnostics/tests/suspendConversion/basicSuspendConversionGenerics.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("chainedFunSuspendConversionForSimpleExpression.kt")
|
||||
public void testChainedFunSuspendConversionForSimpleExpression() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/suspendConversion/chainedFunSuspendConversionForSimpleExpression.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("severalConversionsInOneCall.kt")
|
||||
public void testSeveralConversionsInOneCall() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/suspendConversion/severalConversionsInOneCall.kt");
|
||||
|
||||
Generated
+5
@@ -23023,6 +23023,11 @@ public class DiagnosticsUsingJavacTestGenerated extends AbstractDiagnosticsUsing
|
||||
runTest("compiler/testData/diagnostics/tests/suspendConversion/basicSuspendConversionGenerics.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("chainedFunSuspendConversionForSimpleExpression.kt")
|
||||
public void testChainedFunSuspendConversionForSimpleExpression() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/suspendConversion/chainedFunSuspendConversionForSimpleExpression.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("severalConversionsInOneCall.kt")
|
||||
public void testSeveralConversionsInOneCall() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/suspendConversion/severalConversionsInOneCall.kt");
|
||||
|
||||
Reference in New Issue
Block a user