[NI] Resolve callable reference eagerly if there is only one candidate

#KT-30737 Fixed
This commit is contained in:
Mikhail Zarechenskiy
2019-04-04 03:02:53 +03:00
parent aa96a05469
commit 20a7f387bf
23 changed files with 420 additions and 16 deletions
@@ -16,17 +16,16 @@ fun test(f1: (Int) -> Unit, f2: kotlin.Function1<Int, Unit>) {
select3(null, f1, ::bar)
select3(null, f2, ::bar)
select3(null, f1, <!TYPE_MISMATCH!>::foo<!>)
select3(null, f2, <!TYPE_MISMATCH!>::foo<!>)
select3(null, f1, ::foo)
select3(null, f2, ::foo)
dependantSelect2(null, ::foo)
dependantSelect3(null, ::foo, ::cloneFoo)
dependantSelect3(null, f1, ::bar)
dependantSelect3(null, ::bar, f1)
// These errors are actually can be fixed (and, probably, should) if we force resolution of callable reference
dependantSelect3(null, ::foo, <!TYPE_MISMATCH!>::bar<!>)
dependantSelect3(null, ::bar, <!TYPE_MISMATCH!>::foo<!>)
dependantSelect3(null, f1, <!TYPE_MISMATCH!>::foo<!>)
dependantSelect3(null, <!TYPE_MISMATCH!>::foo<!>, f1)
dependantSelect3(null, ::foo, ::bar)
dependantSelect3(null, ::bar, ::foo)
dependantSelect3(null, f1, ::foo)
dependantSelect3(null, ::foo, f1)
}