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:
+2
-2
@@ -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
|
||||
+10
-10
@@ -1,28 +1,28 @@
|
||||
compiler/testData/cli/jvm/diagnosticsOrder1.kt:1:5: error: redeclaration: x
|
||||
compiler/testData/cli/jvm/diagnosticsOrder1.kt:1:5: error: conflicting declarations: public val x: Int, public val x: Int, public val x: Int, public val x: Int, public val x: Int, public val x: Int, public val x: Int
|
||||
val x = 5
|
||||
^
|
||||
compiler/testData/cli/jvm/diagnosticsOrder1.kt:2:5: error: redeclaration: x
|
||||
compiler/testData/cli/jvm/diagnosticsOrder1.kt:2:5: error: conflicting declarations: public val x: Int, public val x: Int, public val x: Int, public val x: Int, public val x: Int, public val x: Int, public val x: Int
|
||||
val x = 5
|
||||
^
|
||||
compiler/testData/cli/jvm/diagnosticsOrder1.kt:3:5: error: redeclaration: x
|
||||
compiler/testData/cli/jvm/diagnosticsOrder1.kt:3:5: error: conflicting declarations: public val x: Int, public val x: Int, public val x: Int, public val x: Int, public val x: Int, public val x: Int, public val x: Int
|
||||
val x = 5
|
||||
^
|
||||
compiler/testData/cli/jvm/diagnosticsOrder1.kt:4:5: error: redeclaration: x
|
||||
compiler/testData/cli/jvm/diagnosticsOrder1.kt:4:5: error: conflicting declarations: public val x: Int, public val x: Int, public val x: Int, public val x: Int, public val x: Int, public val x: Int, public val x: Int
|
||||
val x = 5
|
||||
^
|
||||
compiler/testData/cli/jvm/diagnosticsOrder1.kt:5:5: error: redeclaration: x
|
||||
compiler/testData/cli/jvm/diagnosticsOrder1.kt:5:5: error: conflicting declarations: public val x: Int, public val x: Int, public val x: Int, public val x: Int, public val x: Int, public val x: Int, public val x: Int
|
||||
val x = 5
|
||||
^
|
||||
compiler/testData/cli/jvm/diagnosticsOrder1.kt:6:5: error: redeclaration: x
|
||||
compiler/testData/cli/jvm/diagnosticsOrder1.kt:6:5: error: conflicting declarations: public val x: Int, public val x: Int, public val x: Int, public val x: Int, public val x: Int, public val x: Int, public val x: Int
|
||||
val x = 5
|
||||
^
|
||||
compiler/testData/cli/jvm/diagnosticsOrder1.kt:7:5: error: redeclaration: x
|
||||
compiler/testData/cli/jvm/diagnosticsOrder1.kt:7:5: error: conflicting declarations: public val x: Int, public val x: Int, public val x: Int, public val x: Int, public val x: Int, public val x: Int, public val x: Int
|
||||
val x = 5
|
||||
^
|
||||
compiler/testData/cli/jvm/diagnosticsOrder2.kt:1:5: error: redeclaration: y
|
||||
compiler/testData/cli/jvm/diagnosticsOrder2.kt:1:5: error: conflicting declarations: public val y: Int, public val y: Int
|
||||
val y = 5
|
||||
^
|
||||
compiler/testData/cli/jvm/diagnosticsOrder2.kt:2:5: error: redeclaration: y
|
||||
compiler/testData/cli/jvm/diagnosticsOrder2.kt:2:5: error: conflicting declarations: public val y: Int, public val y: Int
|
||||
val y = 5
|
||||
^
|
||||
COMPILATION_ERROR
|
||||
COMPILATION_ERROR
|
||||
Reference in New Issue
Block a user