Minor. Add regression test
#KT-52561 Fixed
This commit is contained in:
+6
@@ -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 {
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
+6
@@ -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 {
|
||||
|
||||
+6
@@ -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 {
|
||||
|
||||
+5
@@ -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");
|
||||
|
||||
+6
@@ -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 {
|
||||
|
||||
+6
@@ -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 {
|
||||
|
||||
+5
@@ -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");
|
||||
|
||||
+6
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user