e6f4d6e6fa
^KT-65406
63 lines
827 B
Kotlin
Vendored
63 lines
827 B
Kotlin
Vendored
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 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
|
|
})
|
|
}
|
|
|
|
fun testUnbound() {
|
|
use1(fn = { // BLOCK
|
|
local fun foo(p0: A, p1: Int) {
|
|
p0.foo(xs = [p1]) /*~> Unit */
|
|
}
|
|
|
|
::foo
|
|
})
|
|
}
|
|
|
|
fun use1(fn: Function2<A, Int, Unit>) {
|
|
}
|
|
|
|
fun use2(fn: Function1<Int, Unit>) {
|
|
}
|
|
|