Support extensions in functional supertypes

Under a flag for now.
This commit is contained in:
Ilmir Usmanov
2021-10-13 00:18:27 +02:00
committed by teamcityserver
parent 10101dc2b4
commit 3f8fa3149b
17 changed files with 118 additions and 2 deletions
@@ -0,0 +1,15 @@
// !LANGUAGE: +FunctionalTypeWithExtensionAsSupertype
// IGNORE_BACKEND: JS, JS_IR, WASM
interface I: (String) -> String
class C: String.() -> String, I {
override fun invoke(p1: String): String = p1
}
fun box(): String {
val c = C()
if (c("OK") != "OK") return c("OK")
val ext: String.() -> String = c
return "OK".ext()
}