From a3a79e429575ccde76b9d0ffaa13f75674ff6ee7 Mon Sep 17 00:00:00 2001 From: Dmitriy Novozhilov Date: Mon, 6 Jul 2020 16:29:07 +0300 Subject: [PATCH] [FIR] Update testdata due to incorrect SAM detection --- .../inference/plusAssignWithLambdaInRhs.kt | 24 +++++++++---------- .../testData/codegen/box/coroutines/await.kt | 1 + 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/inference/plusAssignWithLambdaInRhs.kt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/inference/plusAssignWithLambdaInRhs.kt index a0b34537ed3..0b6f7f5f632 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/inference/plusAssignWithLambdaInRhs.kt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/inference/plusAssignWithLambdaInRhs.kt @@ -3,17 +3,17 @@ fun test() { val list: MutableList<(String) -> String> = null!! - list += { it } + list += { it } } -//class A(private val executor: ((T) -> Unit) -> Unit) -// -//fun postpone(computation: () -> T): A { -// val queue = mutableListOf<() -> Unit>() -// -// return A { resolve -> -// queue += { -// resolve(computation()) -// } -// } -//} +class A(private val executor: ((T) -> Unit) -> Unit) + +fun postpone(computation: () -> T): A { + val queue = mutableListOf<() -> Unit>() + + return A { resolve -> + queue += { + resolve(computation()) + } + } +} diff --git a/compiler/testData/codegen/box/coroutines/await.kt b/compiler/testData/codegen/box/coroutines/await.kt index a47acf9136e..de38a4c1ce5 100644 --- a/compiler/testData/codegen/box/coroutines/await.kt +++ b/compiler/testData/codegen/box/coroutines/await.kt @@ -1,3 +1,4 @@ +// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME // WITH_RUNTIME // WITH_COROUTINES