[Wasm] Reuse Callable reference and SAM lowerings from JS

This commit is contained in:
Svyatoslav Kuzmich
2021-10-06 15:23:55 +03:00
parent fbbd436e54
commit 9ef899ef10
80 changed files with 74 additions and 441 deletions
@@ -1,5 +1,4 @@
// IGNORE_BACKEND: JVM
// IGNORE_BACKEND: WASM
// !LANGUAGE: +SuspendConversion
// !DIAGNOSTICS: -UNUSED_PARAMETER
@@ -1,5 +1,4 @@
// IGNORE_BACKEND: JVM
// IGNORE_BACKEND: WASM
// !DIAGNOSTICS: -UNUSED_PARAMETER
@@ -1,6 +1,5 @@
// !LANGUAGE: +SuspendConversion
// !DIAGNOSTICS: -UNUSED_PARAMETER
// IGNORE_BACKEND: WASM
fun foo1(f: suspend () -> Unit) {}
fun bar1() {}
@@ -1,7 +1,6 @@
// !LANGUAGE: +SuspendConversion
// !DIAGNOSTICS: -UNUSED_PARAMETER
// IGNORE_BACKEND: JVM
// IGNORE_BACKEND: WASM
var foo1 = false
var foo2 = false
@@ -2,7 +2,6 @@
// !LANGUAGE: +SuspendConversion
// !DIAGNOSTICS: -UNUSED_PARAMETER
// IGNORE_BACKEND: JVM
// IGNORE_BACKEND: WASM
fun foo(f: () -> String, g: suspend () -> String, h: suspend () -> String) {}
@@ -1,7 +1,6 @@
// !LANGUAGE: +SuspendConversion
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_EXPRESSION
// IGNORE_BACKEND: JVM
// IGNORE_BACKEND: WASM
// IGNORE_BACKEND_FIR: JVM_IR
fun interface Runnable {
@@ -1,7 +1,6 @@
// !LANGUAGE: +SuspendConversion
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_EXPRESSION
// WITH_RUNTIME
// IGNORE_BACKEND: WASM
// IGNORE_BACKEND_FIR: JVM_IR
object Test1 {
@@ -2,7 +2,6 @@
// !LANGUAGE: +SuspendConversion
// !DIAGNOSTICS: -UNUSED_PARAMETER
// IGNORE_BACKEND: JVM
// IGNORE_BACKEND: WASM
// IGNORE_BACKEND_FIR: JVM_IR
fun useSuspendVararg(vararg sfn: suspend () -> Unit) {}
@@ -1,7 +1,6 @@
// FIR_IDENTICAL
// !LANGUAGE: +SuspendConversion
// !DIAGNOSTICS: -UNUSED_PARAMETER
// IGNORE_BACKEND: WASM
fun unitCoercion(f: suspend () -> Unit) {}
fun foo(): Int = 0