Generalize signature comparison: checking for conflicting overloads.

Also, vararg parameter no longer conflicts with Array<out T>
(CONFLICTING_JVM_DECLARATIONS is reported, can be avoided using @JvmName).
This commit is contained in:
Dmitry Petrov
2016-02-17 18:10:53 +03:00
parent 4ac05f1cd8
commit 8a2b80fe3f
7 changed files with 102 additions and 133 deletions
@@ -1,5 +1,8 @@
<!CONFLICTING_OVERLOADS!>fun foo(vararg <!UNUSED_PARAMETER!>x<!>: Int)<!> {}
<!CONFLICTING_OVERLOADS!>fun foo(<!UNUSED_PARAMETER!>x<!>: IntArray)<!> {}
<!CONFLICTING_JVM_DECLARATIONS!>fun foo(vararg <!UNUSED_PARAMETER!>x<!>: Int)<!> {}
<!CONFLICTING_JVM_DECLARATIONS!>fun foo(<!UNUSED_PARAMETER!>x<!>: IntArray)<!> {}
<!CONFLICTING_JVM_DECLARATIONS!>fun foo(vararg <!UNUSED_PARAMETER!>x<!>: Int?)<!> {}
<!CONFLICTING_JVM_DECLARATIONS!>fun foo(<!UNUSED_PARAMETER!>x<!>: Array<Int>)<!> {}
<!CONFLICTING_JVM_DECLARATIONS!>fun foo(<!UNUSED_PARAMETER!>x<!>: Array<Int>)<!> {}
<!CONFLICTING_JVM_DECLARATIONS!>fun foo(vararg <!UNUSED_PARAMETER!>nn<!>: Number)<!> {}
<!CONFLICTING_JVM_DECLARATIONS!>fun foo(<!UNUSED_PARAMETER!>nn<!>: Array<out Number>)<!> {}