NI: Report incompatible receiver of callable reference

^KT-35535 Fixed
This commit is contained in:
Denis Zharkov
2019-12-18 15:26:00 +03:00
parent dd56c3d918
commit c486fa6189
8 changed files with 72 additions and 7 deletions
@@ -0,0 +1,19 @@
// SKIP_TXT
// !LANGUAGE: +NewInference
// !DIAGNOSTICS: -UNUSED_PARAMETER
package test
import kotlin.reflect.KProperty1
interface A {
val bla: CharSequence get() = ""
}
class B<T>(val x: T)
fun <K, V> B<K>.foo(p: KProperty1<K, V>) {}
class C : A
fun <R : A> B<R>.test(){
<!INAPPLICABLE_CANDIDATE!>foo<!>(C::bla)
}
@@ -0,0 +1,19 @@
// SKIP_TXT
// !LANGUAGE: +NewInference
// !DIAGNOSTICS: -UNUSED_PARAMETER
package test
import kotlin.reflect.KProperty1
interface A {
val bla: CharSequence get() = ""
}
class B<T>(val x: T)
fun <K, V> B<K>.foo(p: KProperty1<K, V>) {}
class C : A
fun <R : A> B<R>.test(){
foo(<!TYPE_MISMATCH, TYPE_MISMATCH, TYPE_MISMATCH!>C::bla<!>)
}