Files
kotlin-fork/compiler/testData/ir/irText/expressions/callableReferences/unboundMemberReferenceWithAdaptedArguments.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

62 lines
826 B
Plaintext
Vendored

fun use1(fn: Function2<A, Int, Unit>) {
}
fun use2(fn: Function1<Int, Unit>) {
}
open class A {
constructor() /* primary */ {
super/*Any*/()
/* <init>() */
}
open fun foo(vararg xs: Int): Int {
return 1
}
}
object Obj : A {
private constructor() /* primary */ {
super/*A*/()
/* <init>() */
}
override fun foo(vararg xs: Int): Int {
return 1
}
}
fun testUnbound() {
use1(fn = { // BLOCK
local fun foo(p0: A, p1: Int) {
p0.foo(xs = [p1]) /*~> Unit */
}
::foo
})
}
fun testBound(a: A) {
use2(fn = { // BLOCK
local fun A.foo(p0: Int) {
receiver.foo(xs = [p0]) /*~> Unit */
}
a::foo
})
}
fun testObject() {
use2(fn = { // BLOCK
local fun Obj.foo(p0: Int) {
receiver.foo(xs = [p0]) /*~> Unit */
}
Obj::foo
})
}