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

29 lines
837 B
Kotlin
Vendored

// !LANGUAGE: -CallableReferencesToClassMembersWithEmptyLHS
class A {
fun memberFunction() {}
val memberProperty: Int get() = 42
fun test() {
(::<!UNSUPPORTED_FEATURE!>memberFunction<!>)()
(::<!UNSUPPORTED_FEATURE!>extensionFunction<!>)()
(::<!UNSUPPORTED_FEATURE!>memberProperty<!>)()
(::<!UNSUPPORTED_FEATURE!>extensionProperty<!>)()
}
inner class B {
fun memberFunction() { }
val memberProperty: Int get() = 43
fun test() {
(::<!UNSUPPORTED_FEATURE!>memberFunction<!>)()
(::<!UNSUPPORTED_FEATURE!>extensionFunction<!>)()
(::<!UNSUPPORTED_FEATURE!>memberProperty<!>)()
(::<!UNSUPPORTED_FEATURE!>extensionProperty<!>)()
}
}
}
fun A.extensionFunction() {}
val A.extensionProperty: Int get() = 44