Filter out overridden candidates before looking for most specific

This filtering will remove signature duplicates that prevent findMaximallySpecific() from finding best candidate.
This commit is contained in:
Nikolay Krasko
2015-07-02 18:27:13 +03:00
parent 01b83b3e3e
commit ff9c251438
4 changed files with 72 additions and 7 deletions
@@ -0,0 +1,26 @@
// !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER
// MODULE: m1
// FILE: a.kt
package p
public fun foo(a: Int) {}
public fun foo(vararg values: Int) {}
// MODULE: m2
// FILE: b.kt
package p
public fun foo(a: Int) {}
public fun foo(vararg values: Int) {}
// MODULE: m3(m1, m2)
// FILE: c.kt
package m
import p.foo
fun main() {
foo(12)
}
@@ -0,0 +1,33 @@
// -- Module: <m1> --
package
package p {
public fun foo(/*0*/ a: kotlin.Int): kotlin.Unit
public fun foo(/*0*/ vararg values: kotlin.Int /*kotlin.IntArray*/): kotlin.Unit
}
// -- Module: <m2> --
package
package p {
public fun foo(/*0*/ a: kotlin.Int): kotlin.Unit
public fun foo(/*0*/ vararg values: kotlin.Int /*kotlin.IntArray*/): kotlin.Unit
}
// -- Module: <m3> --
package
package m {
internal fun main(): kotlin.Unit
}
package p {
public fun foo(/*0*/ a: kotlin.Int): kotlin.Unit
public fun foo(/*0*/ a: kotlin.Int): kotlin.Unit
public fun foo(/*0*/ vararg values: kotlin.Int /*kotlin.IntArray*/): kotlin.Unit
public fun foo(/*0*/ vararg values: kotlin.Int /*kotlin.IntArray*/): kotlin.Unit
}