[FE] Fix tests

This commit is contained in:
Victor Petukhov
2022-04-22 14:02:43 +03:00
committed by teamcity
parent 12a39d0330
commit 0f1d212fc5
20 changed files with 201 additions and 108 deletions
@@ -1,41 +0,0 @@
// IGNORE_BACKEND: WASM
// WASM_MUTE_REASON: IGNORED_IN_JS
// IGNORE_BACKEND: JS, JS_IR
// IGNORE_BACKEND: JS_IR_ES6
fun interface KRunnable {
fun invoke()
}
fun interface KBoolean {
fun invoke(b: Boolean)
}
fun useFunInterface(fn: KRunnable) {
fn.invoke()
}
fun useFunInterfacePredicate(fn: KBoolean) {
fn.invoke(true)
}
fun <T> testIntersection(x: T) where T : () -> Unit, T : (Boolean) -> Unit {
useFunInterface(x)
useFunInterfacePredicate(x)
}
var result = ""
object Test : () -> Unit, (Boolean) -> Unit {
override fun invoke() {
result += "O"
}
override fun invoke(p1: Boolean) {
if (p1) result += "K"
}
}
fun box(): String {
testIntersection(Test)
return result
}