KT-47939 basic fun interface constructor reference box test
This commit is contained in:
committed by
TeamCityServer
parent
11daed8b01
commit
58f1504aaf
Vendored
+13
@@ -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()
|
||||
Reference in New Issue
Block a user