Add regression test for KT-20744

#KT-20744: Obsolete
This commit is contained in:
Ilmir Usmanov
2018-03-16 21:56:24 +03:00
parent 2d4ef8d1e6
commit 7b2de2de5e
5 changed files with 51 additions and 0 deletions
@@ -0,0 +1,27 @@
// WITH_RUNTIME
// WITH_COROUTINES
import helpers.*
import kotlin.coroutines.experimental.*
import kotlin.properties.Delegates
class Pipe {
var value = 0
suspend fun send(value: Int) {
this.value = value
}
}
fun builder(c: suspend () -> Unit) {
c.startCoroutine(EmptyContinuation)
}
val pipe = Pipe()
var mode by Delegates.observable(0) {_, _, value -> builder { pipe.send(value) }}
fun box() : String {
mode = 42
if (pipe.value != 42) return "FAIL"
return "OK"
}
@@ -6283,6 +6283,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
doTest(fileName);
}
@TestMetadata("delegate.kt")
public void testDelegate() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/delegate.kt");
doTest(fileName);
}
@TestMetadata("destructuringInLambdas.kt")
public void testDestructuringInLambdas() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/destructuringInLambdas.kt");
@@ -6283,6 +6283,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
doTest(fileName);
}
@TestMetadata("delegate.kt")
public void testDelegate() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/delegate.kt");
doTest(fileName);
}
@TestMetadata("destructuringInLambdas.kt")
public void testDestructuringInLambdas() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/destructuringInLambdas.kt");
@@ -6283,6 +6283,12 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
doTest(fileName);
}
@TestMetadata("delegate.kt")
public void testDelegate() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/delegate.kt");
doTest(fileName);
}
@TestMetadata("destructuringInLambdas.kt")
public void testDestructuringInLambdas() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/destructuringInLambdas.kt");
@@ -7602,6 +7602,12 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
doTest(fileName);
}
@TestMetadata("delegate.kt")
public void testDelegate() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/delegate.kt");
doTest(fileName);
}
@TestMetadata("destructuringInLambdas.kt")
public void testDestructuringInLambdas() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/coroutines/featureIntersection/destructuringInLambdas.kt");