mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-16 08:31:35 +00:00
Despite the fact that the LHS of a double colon expression is now KtExpression instead of KtUserType, we must still consider it a type for callable references to work. Extract and reuse relevant parts of QualifiedExpressionResolver and TypeResolver to support this behavior
17 lines
253 B
Kotlin
Vendored
17 lines
253 B
Kotlin
Vendored
// !CHECK_TYPE
|
|
|
|
class Foo
|
|
|
|
fun Foo?.bar() {}
|
|
|
|
fun test() {
|
|
val r1 = Foo ?:: bar
|
|
checkSubtype<(Foo?) -> Unit>(r1)
|
|
|
|
val r2 = Foo ? :: bar
|
|
checkSubtype<(Foo?) -> Unit>(r2)
|
|
|
|
val r3 = Foo ? ? :: bar
|
|
checkSubtype<(Foo?) -> Unit>(r3)
|
|
}
|