K2: reproduce KT-61933

This commit is contained in:
Mikhail Glukhikh
2023-09-18 11:51:23 +02:00
committed by Space Team
parent ad4d1a5ba8
commit 0c287c9945
7 changed files with 64 additions and 0 deletions
@@ -33406,6 +33406,12 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia
runTest("compiler/testData/diagnostics/tests/suspendConversion/chainedFunSuspendConversionForSimpleExpression.kt");
}
@Test
@TestMetadata("inGenericArgument.kt")
public void testInGenericArgument() throws Exception {
runTest("compiler/testData/diagnostics/tests/suspendConversion/inGenericArgument.kt");
}
@Test
@TestMetadata("overloadResolutionBySuspendModifier.kt")
public void testOverloadResolutionBySuspendModifier() throws Exception {
@@ -33406,6 +33406,12 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated
runTest("compiler/testData/diagnostics/tests/suspendConversion/chainedFunSuspendConversionForSimpleExpression.kt");
}
@Test
@TestMetadata("inGenericArgument.kt")
public void testInGenericArgument() throws Exception {
runTest("compiler/testData/diagnostics/tests/suspendConversion/inGenericArgument.kt");
}
@Test
@TestMetadata("overloadResolutionBySuspendModifier.kt")
public void testOverloadResolutionBySuspendModifier() throws Exception {
@@ -33406,6 +33406,12 @@ public class FirLightTreeOldFrontendDiagnosticsTestGenerated extends AbstractFir
runTest("compiler/testData/diagnostics/tests/suspendConversion/chainedFunSuspendConversionForSimpleExpression.kt");
}
@Test
@TestMetadata("inGenericArgument.kt")
public void testInGenericArgument() throws Exception {
runTest("compiler/testData/diagnostics/tests/suspendConversion/inGenericArgument.kt");
}
@Test
@TestMetadata("overloadResolutionBySuspendModifier.kt")
public void testOverloadResolutionBySuspendModifier() throws Exception {
@@ -33520,6 +33520,12 @@ public class FirPsiOldFrontendDiagnosticsTestGenerated extends AbstractFirPsiDia
runTest("compiler/testData/diagnostics/tests/suspendConversion/chainedFunSuspendConversionForSimpleExpression.kt");
}
@Test
@TestMetadata("inGenericArgument.kt")
public void testInGenericArgument() throws Exception {
runTest("compiler/testData/diagnostics/tests/suspendConversion/inGenericArgument.kt");
}
@Test
@TestMetadata("overloadResolutionBySuspendModifier.kt")
public void testOverloadResolutionBySuspendModifier() throws Exception {
@@ -0,0 +1,17 @@
// ISSUE: KT-61933
data class Bar(
val foo: Foo<suspend () -> Unit>
)
data class Foo<out TCallback : Any>(
val state: TCallback?,
)
fun usage(b: Boolean) {
Bar(
foo = <!ARGUMENT_TYPE_MISMATCH!>Foo(
state = if (b) { -> } else null,
)<!>
)
}
@@ -0,0 +1,17 @@
// ISSUE: KT-61933
data class Bar(
val foo: Foo<suspend () -> Unit>
)
data class Foo<out TCallback : Any>(
val state: TCallback?,
)
fun usage(b: Boolean) {
Bar(
foo = Foo(
state = if (b) { -> } else null,
)
)
}
@@ -35302,6 +35302,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest {
runTest("compiler/testData/diagnostics/tests/suspendConversion/chainedFunSuspendConversionForSimpleExpression.kt");
}
@Test
@TestMetadata("inGenericArgument.kt")
public void testInGenericArgument() throws Exception {
runTest("compiler/testData/diagnostics/tests/suspendConversion/inGenericArgument.kt");
}
@Test
@TestMetadata("overloadResolutionBySuspendModifier.kt")
public void testOverloadResolutionBySuspendModifier() throws Exception {