KT-6244 Overloads with no default parameters should take over ones with defaults

#KT-6244 Fixed
This commit is contained in:
Stanislav Erokhin
2015-08-31 22:07:37 +03:00
parent 5ded315cbb
commit d015f713cb
14 changed files with 99 additions and 16 deletions
@@ -7,4 +7,4 @@ fun foo(s: String) {}
val x1 = ofType<() -> Unit>(::foo)
val x2 = ofType<(String) -> Unit>(::foo)
val x3 = ofType<(Int) -> Unit>(::<!NONE_APPLICABLE!>foo<!>)
val x3 = ofType<(Int) -> Unit>(<!TYPE_MISMATCH!>::foo<!>)
@@ -3,7 +3,7 @@
fun foo() {}
fun foo(s: String) {}
val x1 = ::<!OVERLOAD_RESOLUTION_AMBIGUITY!>foo<!>
val x1 = ::foo
val x2: () -> Unit = ::foo
val x3: (String) -> Unit = ::foo
val x4: (Int) -> Unit = ::<!NONE_APPLICABLE!>foo<!>
val x4: (Int) -> Unit = <!TYPE_MISMATCH!>::foo<!>
@@ -1,6 +1,6 @@
package
internal val x1: [ERROR : Type for ::foo]
internal val x1: kotlin.reflect.KFunction0<kotlin.Unit>
internal val x2: () -> kotlin.Unit
internal val x3: (kotlin.String) -> kotlin.Unit
internal val x4: (kotlin.Int) -> kotlin.Unit
@@ -6,5 +6,5 @@ fun foo(s: String) {}
fun bar(f: () -> Unit) = 1
fun bar(f: (String) -> Unit) = 2
val x1 = ::<!OVERLOAD_RESOLUTION_AMBIGUITY!>foo<!> as () -> Unit
val x2 = bar(::<!OVERLOAD_RESOLUTION_AMBIGUITY!>foo<!> as (String) -> Unit)
val x1 = ::foo <!USELESS_CAST!>as () -> Unit<!>
val x2 = bar(<!UNCHECKED_CAST!>::foo as (String) -> Unit<!>)