K1/K2: add a test to fix state of KT-55168

This commit is contained in:
Mikhail Glukhikh
2023-08-25 16:45:49 +02:00
committed by Space Team
parent d9b5d37baf
commit 3e330241b4
7 changed files with 46 additions and 0 deletions
@@ -37882,6 +37882,12 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/testsWithStdLib/builderInference"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.(reversed|fir|ll)\\.kts?$"), true);
}
@Test
@TestMetadata("buildListRemoveAddInBranches.kt")
public void testBuildListRemoveAddInBranches() throws Exception {
runTest("compiler/testData/diagnostics/testsWithStdLib/builderInference/buildListRemoveAddInBranches.kt");
}
@Test
@TestMetadata("buildListToUpperBound.kt")
public void testBuildListToUpperBound() throws Exception {
@@ -37882,6 +37882,12 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/testsWithStdLib/builderInference"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.(reversed|fir|ll)\\.kts?$"), true);
}
@Test
@TestMetadata("buildListRemoveAddInBranches.kt")
public void testBuildListRemoveAddInBranches() throws Exception {
runTest("compiler/testData/diagnostics/testsWithStdLib/builderInference/buildListRemoveAddInBranches.kt");
}
@Test
@TestMetadata("buildListToUpperBound.kt")
public void testBuildListToUpperBound() throws Exception {
@@ -37882,6 +37882,12 @@ public class FirLightTreeOldFrontendDiagnosticsTestGenerated extends AbstractFir
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/testsWithStdLib/builderInference"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.(reversed|fir|ll)\\.kts?$"), true);
}
@Test
@TestMetadata("buildListRemoveAddInBranches.kt")
public void testBuildListRemoveAddInBranches() throws Exception {
runTest("compiler/testData/diagnostics/testsWithStdLib/builderInference/buildListRemoveAddInBranches.kt");
}
@Test
@TestMetadata("buildListToUpperBound.kt")
public void testBuildListToUpperBound() throws Exception {
@@ -37996,6 +37996,12 @@ public class FirPsiOldFrontendDiagnosticsTestGenerated extends AbstractFirPsiDia
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/testsWithStdLib/builderInference"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.(reversed|fir|ll)\\.kts?$"), true);
}
@Test
@TestMetadata("buildListRemoveAddInBranches.kt")
public void testBuildListRemoveAddInBranches() throws Exception {
runTest("compiler/testData/diagnostics/testsWithStdLib/builderInference/buildListRemoveAddInBranches.kt");
}
@Test
@TestMetadata("buildListToUpperBound.kt")
public void testBuildListToUpperBound() throws Exception {
@@ -0,0 +1,8 @@
// ISSUE: KT-55168
fun foo(arg: Boolean) = buildList {
if (arg) {
removeLast()
} else {
add(42)
}
}
@@ -0,0 +1,8 @@
// ISSUE: KT-55168
fun foo(arg: Boolean) = buildList {
if (arg) <!TYPE_MISMATCH!>{
<!TYPE_MISMATCH!>removeLast()<!>
}<!> else {
add(42)
}
}
@@ -39610,6 +39610,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/testsWithStdLib/builderInference"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.(reversed|fir|ll)\\.kts?$"), true);
}
@Test
@TestMetadata("buildListRemoveAddInBranches.kt")
public void testBuildListRemoveAddInBranches() throws Exception {
runTest("compiler/testData/diagnostics/testsWithStdLib/builderInference/buildListRemoveAddInBranches.kt");
}
@Test
@TestMetadata("buildListToUpperBound.kt")
public void testBuildListToUpperBound() throws Exception {