Add test for questionable chained fun -> suspend conversion

This commit is contained in:
Mikhail Zarechenskiy
2020-04-22 05:31:38 +03:00
parent ac642cf175
commit cb975bde7c
6 changed files with 53 additions and 0 deletions
@@ -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");
@@ -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)
}
@@ -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<!>)
}
@@ -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");
@@ -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");