3eeccb407e
Previously its call sites needed to determine if the receiver type should be ignored (e.g. if the reference is to static member or nested class constructor, or if it's a bound reference), and 3 of 4 callers did it incorrectly. Simplify this by passing the DoubleColonLHS instance everywhere. Also rename it to createKCallableTypeForReference #KT-12738 Fixed #KT-12751 Fixed #KT-12799 Fixed
16 lines
329 B
Kotlin
Vendored
16 lines
329 B
Kotlin
Vendored
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
|
// KT-12751 Type inference failed with forEach and bound reference
|
|
|
|
class L<out T>
|
|
|
|
fun <T> L<T>.foo(action: (T) -> Unit): Unit {}
|
|
|
|
class B {
|
|
fun remove(charSequence: CharSequence) {}
|
|
}
|
|
|
|
fun foo(list: L<CharSequence>, b: B) {
|
|
list.foo(b::remove)
|
|
list.foo<CharSequence>(b::remove)
|
|
}
|