Minor. Add regression test

#KT-52561 Fixed
This commit is contained in:
Ilmir Usmanov
2022-05-29 19:19:47 +02:00
committed by teamcity
parent 4a7a0126f2
commit f922684169
9 changed files with 77 additions and 0 deletions
@@ -10251,6 +10251,12 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT
runTest("compiler/testData/codegen/box/coroutines/kt52311_nullOnRight.kt");
}
@Test
@TestMetadata("kt52561.kt")
public void testKt52561() throws Exception {
runTest("compiler/testData/codegen/box/coroutines/kt52561.kt");
}
@Test
@TestMetadata("lastExpressionIsLoop.kt")
public void testLastExpressionIsLoop() throws Exception {
+31
View File
@@ -0,0 +1,31 @@
// WITH_STDLIB
// WITH_COROUTINES
import helpers.*
import kotlin.coroutines.*
import kotlin.coroutines.intrinsics.*
fun someCondition() = true
suspend fun suspendHere() = suspendCoroutineUninterceptedOrReturn {
it.resume(Unit)
COROUTINE_SUSPENDED
}
fun expectString(x: String?) {
if (x != "TEST") error("FAIL: $x")
}
suspend fun test(block: (String) -> Unit) {
val string: String? = "TEST".takeIf { true }
check(string != null) // smartcast from String? to String
expectString(string)
suspendHere()
expectString(string)
block(string)
}
fun box(): String {
suspend { test {} }.startCoroutine(EmptyContinuation)
return "OK"
}
@@ -10131,6 +10131,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
runTest("compiler/testData/codegen/box/coroutines/kt52311_nullOnRight.kt");
}
@Test
@TestMetadata("kt52561.kt")
public void testKt52561() throws Exception {
runTest("compiler/testData/codegen/box/coroutines/kt52561.kt");
}
@Test
@TestMetadata("lastExpressionIsLoop.kt")
public void testLastExpressionIsLoop() throws Exception {
@@ -10251,6 +10251,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
runTest("compiler/testData/codegen/box/coroutines/kt52311_nullOnRight.kt");
}
@Test
@TestMetadata("kt52561.kt")
public void testKt52561() throws Exception {
runTest("compiler/testData/codegen/box/coroutines/kt52561.kt");
}
@Test
@TestMetadata("lastExpressionIsLoop.kt")
public void testLastExpressionIsLoop() throws Exception {
@@ -7964,6 +7964,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
runTest("compiler/testData/codegen/box/coroutines/kt52311_nullOnRight.kt");
}
@TestMetadata("kt52561.kt")
public void testKt52561() throws Exception {
runTest("compiler/testData/codegen/box/coroutines/kt52561.kt");
}
@TestMetadata("lastExpressionIsLoop.kt")
public void testLastExpressionIsLoop() throws Exception {
runTest("compiler/testData/codegen/box/coroutines/lastExpressionIsLoop.kt");
@@ -7193,6 +7193,12 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
runTest("compiler/testData/codegen/box/coroutines/kt52311_nullOnRight.kt");
}
@Test
@TestMetadata("kt52561.kt")
public void testKt52561() throws Exception {
runTest("compiler/testData/codegen/box/coroutines/kt52561.kt");
}
@Test
@TestMetadata("lastExpressionIsLoop.kt")
public void testLastExpressionIsLoop() throws Exception {
@@ -7235,6 +7235,12 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
runTest("compiler/testData/codegen/box/coroutines/kt52311_nullOnRight.kt");
}
@Test
@TestMetadata("kt52561.kt")
public void testKt52561() throws Exception {
runTest("compiler/testData/codegen/box/coroutines/kt52561.kt");
}
@Test
@TestMetadata("lastExpressionIsLoop.kt")
public void testLastExpressionIsLoop() throws Exception {
@@ -6364,6 +6364,11 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest
runTest("compiler/testData/codegen/box/coroutines/kt52311_nullOnRight.kt");
}
@TestMetadata("kt52561.kt")
public void testKt52561() throws Exception {
runTest("compiler/testData/codegen/box/coroutines/kt52561.kt");
}
@TestMetadata("lastExpressionIsLoop.kt")
public void testLastExpressionIsLoop() throws Exception {
runTest("compiler/testData/codegen/box/coroutines/lastExpressionIsLoop.kt");
@@ -8095,6 +8095,12 @@ public class NativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTest
runTest("compiler/testData/codegen/box/coroutines/kt52311_nullOnRight.kt");
}
@Test
@TestMetadata("kt52561.kt")
public void testKt52561() throws Exception {
runTest("compiler/testData/codegen/box/coroutines/kt52561.kt");
}
@Test
@TestMetadata("lastExpressionIsLoop.kt")
public void testLastExpressionIsLoop() throws Exception {