Files
kotlin-fork/compiler/testData/ir/irText/expressions/funInterface/samConversionOnCallableReference.kt
T
Dmitry Petrov c540116b71 IR: additional callable reference adapter stuff in IR
- IrFunctionReference.reflectionTarget: IrFunctionSymbol?
- add separate declaration origin for callable reference adapters
- bump IR ABI version
2020-01-24 11:21:26 +03:00

25 lines
520 B
Kotlin
Vendored

// !LANGUAGE: +NewInference +FunctionalInterfaceConversion +SamConversionPerArgument +SamConversionForKotlinFunctions
fun interface KRunnable {
fun run()
}
fun foo0() {}
fun foo1(vararg xs: Int): Int = 1
fun use(r: KRunnable) {}
fun testSamConstructor() =
KRunnable(::foo0)
// TODO should use an adapter function
fun testSamCosntructorOnAdapted() =
KRunnable(::foo1)
fun testSamConversion() {
use(::foo0)
}
// TODO should use an adapter function
fun testSamConversionOnAdapted() {
use(::foo1)
}