Files
kotlin/compiler/testData/diagnostics/tests/callableReference/function/noAmbiguityMemberVsTopLevel.kt
Alexander Udalov 661f4efc68 Forbid callable references to members and extensions with empty LHS
This syntax is reserved to be likely used in the future as a shorthand for
"this::foo" where the resulting expression doesn't take the receiver as a
parameter but has "this" already bound to it
2015-10-03 04:37:04 +03:00

16 lines
252 B
Kotlin
Vendored

// !CHECK_TYPE
import kotlin.reflect.KFunction1
fun foo() {}
class A {
fun foo() {}
fun main() {
val x = ::<!CALLABLE_REFERENCE_TO_MEMBER_OR_EXTENSION_WITH_EMPTY_LHS!>foo<!>
checkSubtype<KFunction1<A, Unit>>(x)
}
}