KT-47939 basic fun interface constructor reference box test

This commit is contained in:
Dmitry Petrov
2021-11-29 19:31:25 +03:00
committed by TeamCityServer
parent 11daed8b01
commit 58f1504aaf
12 changed files with 168 additions and 22 deletions
@@ -0,0 +1,13 @@
// !LANGUAGE: +AllowKotlinFunInterfaceConstructorReference
// IGNORE_BACKEND: JVM, JS
// ^ feature supported in IR-based backends only
fun interface KSupplier<T> {
fun get(): T
}
val ks: (() -> String) -> KSupplier<String> =
::KSupplier
fun box(): String =
ks { "OK" }.get()