Files
kotlin-fork/compiler/testData/diagnostics/tests/callableReference/function/innerConstructorFromClass.kt
T
Alexander Udalov 2877314313 Support "::foo" as a short-hand for "this::foo"
#KT-15667 Fixed
2017-09-08 10:59:44 +03:00

34 lines
642 B
Kotlin
Vendored

// !CHECK_TYPE
// !DIAGNOSTICS: -UNUSED_EXPRESSION
// !LANGUAGE: +CallableReferencesToClassMembersWithEmptyLHS
import kotlin.reflect.KFunction1
class A {
inner class Inner
fun main() {
::Inner
val y = A::Inner
checkSubtype<KFunction1<A, Inner>>(y)
}
companion object {
fun main() {
::<!UNRESOLVED_REFERENCE!>Inner<!>
val y = A::Inner
checkSubtype<KFunction1<A, A.Inner>>(y)
}
}
}
class B {
fun main() {
::<!UNRESOLVED_REFERENCE!>Inner<!>
val y = A::Inner
checkSubtype<KFunction1<A, A.Inner>>(y)
}
}