Files
kotlin-fork/compiler/testData/diagnostics/tests/callableReference/function/memberFromClass.kt
T
2015-05-26 14:27:40 +03:00

20 lines
392 B
Kotlin
Vendored

// !CHECK_TYPE
import kotlin.reflect.*
class A {
fun foo() {}
fun bar(<!UNUSED_PARAMETER!>x<!>: Int) {}
fun baz() = "OK"
fun main() {
val x = ::foo
val y = ::bar
val z = ::baz
checkSubtype<KMemberFunction0<A, Unit>>(x)
checkSubtype<KMemberFunction1<A, Int, Unit>>(y)
checkSubtype<KMemberFunction0<A, String>>(z)
}
}