Support extensions in functional supertypes
Under a flag for now.
This commit is contained in:
committed by
teamcityserver
parent
10101dc2b4
commit
3f8fa3149b
+15
@@ -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()
|
||||
}
|
||||
Reference in New Issue
Block a user