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

24 lines
430 B
Kotlin
Vendored

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