KT-9601, KT-10103:

Chose maximally specific function in callable reference
 #KT-9601 Fixed
 #KT-10103 Fixed
This commit is contained in:
Dmitry Petrov
2015-11-24 19:23:15 +03:00
parent 67dd97b918
commit 9ccb1fd506
16 changed files with 203 additions and 30 deletions
@@ -0,0 +1,21 @@
// !CHECK_TYPE
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE
interface IA
interface IB : IA
fun IA.extFun(x: IB) {}
fun IB.extFun(x: IA) {}
fun test() {
val extFun1 = IA::extFun
val extFun2 = IB::<!OVERLOAD_RESOLUTION_AMBIGUITY!>extFun<!>
}
fun testWithExpectedType() {
val extFun_AB_A: IA.(IB) -> Unit = IA::extFun
val extFun_AA_B: IA.(IA) -> Unit = IB::<!NONE_APPLICABLE!>extFun<!>
val extFun_BB_A: IB.(IB) -> Unit = IA::extFun
val extFun_BA_B: IB.(IA) -> Unit = IB::extFun
val extFun_BB_B: IB.(IB) -> Unit = IB::<!OVERLOAD_RESOLUTION_AMBIGUITY!>extFun<!>
}