KT-13961 REDECLARATION not reported on private-in-file 'foo' vs public 'foo' in different file

Private-in-file declarations conflict with public overload-equivalent declarations
in other files in the same package.

Move functions for grouping possible redeclarations to OverloadResolver
(since they are used only there).

Refactor redeclarations / conflicting overloads reporting.
This commit is contained in:
Dmitry Petrov
2016-09-21 18:12:24 +03:00
parent 0120085443
commit 06101dba52
42 changed files with 293 additions and 297 deletions
+2 -2
View File
@@ -1,7 +1,7 @@
compiler/testData/cli/jvm/conflictingOverloads.kt:1:1: error: 'public fun a(): List<Int>' conflicts with another declaration in package '<root>'
compiler/testData/cli/jvm/conflictingOverloads.kt:1:1: error: conflicting overloads: public fun a(): List<Int> defined in root package, public fun a(): List<String> defined in root package
fun a(): List<Int> = null!!
^
compiler/testData/cli/jvm/conflictingOverloads.kt:2:1: error: 'public fun a(): List<String>' conflicts with another declaration in package '<root>'
compiler/testData/cli/jvm/conflictingOverloads.kt:2:1: error: conflicting overloads: public fun a(): List<Int> defined in root package, public fun a(): List<String> defined in root package
fun a(): List<String> = null!!
^
COMPILATION_ERROR