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

20 lines
359 B
Kotlin

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