Add test case to check delegation of suspend method
This commit is contained in:
committed by
Roman Artemev
parent
f826a253e3
commit
8862b26bbd
@@ -0,0 +1,31 @@
|
||||
// WITH_COROUTINES
|
||||
// COMMON_COROUTINES_TEST
|
||||
|
||||
import helpers.*
|
||||
import COROUTINES_PACKAGE.*
|
||||
import COROUTINES_PACKAGE.intrinsics.*
|
||||
|
||||
var result = "fail"
|
||||
|
||||
interface SuspendInterface {
|
||||
suspend fun foo(v: String)
|
||||
}
|
||||
|
||||
class Delegate : SuspendInterface {
|
||||
override suspend fun foo(v: String) {
|
||||
result = v
|
||||
}
|
||||
}
|
||||
|
||||
class Decorator(parent: SuspendInterface) : SuspendInterface by parent
|
||||
|
||||
fun execute(c: suspend () -> Unit) = c.startCoroutine(EmptyContinuation)
|
||||
|
||||
fun box(): String {
|
||||
|
||||
execute {
|
||||
Decorator(Delegate()).foo("OK")
|
||||
}
|
||||
|
||||
return result
|
||||
}
|
||||
Generated
+12
@@ -5399,6 +5399,18 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
||||
doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines");
|
||||
}
|
||||
|
||||
@TestMetadata("delegatedSuspendMember.kt")
|
||||
public void testDelegatedSuspendMember_1_2() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/delegatedSuspendMember.kt");
|
||||
doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental");
|
||||
}
|
||||
|
||||
@TestMetadata("delegatedSuspendMember.kt")
|
||||
public void testDelegatedSuspendMember_1_3() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/delegatedSuspendMember.kt");
|
||||
doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines");
|
||||
}
|
||||
|
||||
@TestMetadata("dispatchResume.kt")
|
||||
public void testDispatchResume_1_2() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/dispatchResume.kt");
|
||||
|
||||
+12
@@ -5399,6 +5399,18 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
||||
doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines");
|
||||
}
|
||||
|
||||
@TestMetadata("delegatedSuspendMember.kt")
|
||||
public void testDelegatedSuspendMember_1_2() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/delegatedSuspendMember.kt");
|
||||
doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental");
|
||||
}
|
||||
|
||||
@TestMetadata("delegatedSuspendMember.kt")
|
||||
public void testDelegatedSuspendMember_1_3() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/delegatedSuspendMember.kt");
|
||||
doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines");
|
||||
}
|
||||
|
||||
@TestMetadata("dispatchResume.kt")
|
||||
public void testDispatchResume_1_2() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/dispatchResume.kt");
|
||||
|
||||
+12
@@ -5399,6 +5399,18 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
||||
doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines");
|
||||
}
|
||||
|
||||
@TestMetadata("delegatedSuspendMember.kt")
|
||||
public void testDelegatedSuspendMember_1_2() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/delegatedSuspendMember.kt");
|
||||
doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental");
|
||||
}
|
||||
|
||||
@TestMetadata("delegatedSuspendMember.kt")
|
||||
public void testDelegatedSuspendMember_1_3() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/delegatedSuspendMember.kt");
|
||||
doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines");
|
||||
}
|
||||
|
||||
@TestMetadata("dispatchResume.kt")
|
||||
public void testDispatchResume_1_2() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/dispatchResume.kt");
|
||||
|
||||
+6
@@ -5067,6 +5067,12 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
|
||||
doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental");
|
||||
}
|
||||
|
||||
@TestMetadata("delegatedSuspendMember.kt")
|
||||
public void testDelegatedSuspendMember_1_2() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/delegatedSuspendMember.kt");
|
||||
doTestWithCoroutinesPackageReplacement(fileName, "kotlin.coroutines.experimental");
|
||||
}
|
||||
|
||||
@TestMetadata("dispatchResume.kt")
|
||||
public void testDispatchResume_1_2() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/dispatchResume.kt");
|
||||
|
||||
Reference in New Issue
Block a user