Files
kotlin-fork/compiler/testData/diagnostics/tests/callableReference/function/topLevelFromExtensionInClass.kt
T

23 lines
354 B
Kotlin
Vendored

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