NI: Fix property references overload ambiguity

^KT-35213 Fixed
This commit is contained in:
Denis Zharkov
2019-12-18 15:23:56 +03:00
parent ab79c3e0a0
commit dd56c3d918
6 changed files with 46 additions and 3 deletions
@@ -0,0 +1,14 @@
// SKIP_TXT
// !LANGUAGE: +NewInference
// !DIAGNOSTICS: -UNUSED_PARAMETER
fun check1(p: kotlin.reflect.KProperty1<*, *>) {}
fun check2(p: kotlin.reflect.KProperty1<in String, *>) {}
val CharSequence.x: Any get() = this
val BooleanArray.x: Any get() = this
fun box() {
check1(CharSequence::x) // error in NI, ok in OI
check2(CharSequence::x)
}
@@ -0,0 +1,14 @@
// SKIP_TXT
// !LANGUAGE: +NewInference
// !DIAGNOSTICS: -UNUSED_PARAMETER
fun check1(p: kotlin.reflect.KProperty1<*, *>) {}
fun check2(p: kotlin.reflect.KProperty1<in String, *>) {}
val CharSequence.x: Any get() = this
val BooleanArray.x: Any get() = this
fun box() {
check1(CharSequence::x) // error in NI, ok in OI
check2(CharSequence::x)
}