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

24 lines
362 B
Kotlin
Vendored

// !CHECK_TYPE
import kotlin.reflect.KFunction0
class A
class B {
fun A.ext() {
val x = ::A
val y = ::B
checkSubtype<KFunction0<A>>(x)
checkSubtype<KFunction0<B>>(y)
}
fun B.ext() {
val x = ::A
val y = ::B
checkSubtype<KFunction0<A>>(x)
checkSubtype<KFunction0<B>>(y)
}
}