Files
kotlin-fork/compiler/testData/ir/irText/expressions/callableReferences/adaptedWithCoercionToUnit.kt.txt
T
Dmitriy Novozhilov b454fcc1e0 [FIR] Save IR dumps to .ir.txt files instead of .txt in tests
This is needed to avoid clashes between different dumps from different
  handlers
2021-10-12 17:26:36 +03:00

58 lines
706 B
Kotlin
Vendored

fun useUnit0(fn: Function0<Unit>) {
}
fun useUnit1(fn: Function1<Int, Unit>) {
}
fun fn0(): Int {
return 1
}
fun fn1(x: Int): Int {
return 1
}
fun fnv(vararg xs: Int): Int {
return 1
}
fun test0() {
return useUnit0(fn = { // BLOCK
local fun fn0() {
fn0() /*~> Unit */
}
::fn0
})
}
fun test1() {
return useUnit1(fn = { // BLOCK
local fun fn1(p0: Int) {
fn1(x = p0) /*~> Unit */
}
::fn1
})
}
fun testV0() {
return useUnit0(fn = { // BLOCK
local fun fnv() {
fnv() /*~> Unit */
}
::fnv
})
}
fun testV1() {
return useUnit1(fn = { // BLOCK
local fun fnv(p0: Int) {
fnv(xs = [p0]) /*~> Unit */
}
::fnv
})
}