Partial fix for KT-470: Remove duplicating errors on the same element.
Redeclarations for top-level properties still get two REDECLARATION diagnostics. (In overload resolver and declaration resolver) Also added test for redeclaring extension properties. Also remove useless null check.
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
package foo
|
||||
|
||||
val Int.<!REDECLARATION!>foo<!> = 2
|
||||
val Int.<!REDECLARATION!>foo<!> = 3
|
||||
@@ -0,0 +1,9 @@
|
||||
class A() {
|
||||
val a: Int = 1
|
||||
fun a(): Int = 2
|
||||
}
|
||||
|
||||
class B() {
|
||||
fun b(): Int = 2
|
||||
val b: Int = 1
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
val <!REDECLARATION, REDECLARATION!>a<!> : Int = 1
|
||||
val <!REDECLARATION, REDECLARATION!>a<!> : Int = 1
|
||||
val <!REDECLARATION, REDECLARATION!>a<!> : Int = 1
|
||||
|
||||
val <!REDECLARATION, REDECLARATION!>b<!> : Int = 1
|
||||
val <!REDECLARATION, REDECLARATION!>b<!> : Int = 1
|
||||
val <!REDECLARATION, REDECLARATION!>b<!> : Int = 1
|
||||
val <!REDECLARATION, REDECLARATION!>b<!> : Int = 1
|
||||
|
||||
<!CONFLICTING_OVERLOADS!>fun foo()<!> {} // and here too
|
||||
<!CONFLICTING_OVERLOADS!>fun foo()<!> {} // and here
|
||||
<!CONFLICTING_OVERLOADS!>fun foo()<!> {} // and here
|
||||
<!CONFLICTING_OVERLOADS!>fun foo()<!> {} // and here
|
||||
|
||||
<!CONFLICTING_OVERLOADS!>fun bar()<!> {} // and here
|
||||
<!CONFLICTING_OVERLOADS!>fun bar()<!> {} // and here
|
||||
<!CONFLICTING_OVERLOADS!>fun bar()<!> {} // and here
|
||||
|
||||
class A {
|
||||
val <!REDECLARATION!>a<!> : Int = 1
|
||||
val <!REDECLARATION!>a<!> : Int = 1
|
||||
val <!REDECLARATION!>a<!> : Int = 1
|
||||
|
||||
val <!REDECLARATION!>b<!> : Int = 1
|
||||
val <!REDECLARATION!>b<!> : Int = 1
|
||||
val <!REDECLARATION!>b<!> : Int = 1
|
||||
val <!REDECLARATION!>b<!> : Int = 1
|
||||
|
||||
<!CONFLICTING_OVERLOADS!>fun foo()<!> {} // and here too
|
||||
<!CONFLICTING_OVERLOADS!>fun foo()<!> {} // and here
|
||||
<!CONFLICTING_OVERLOADS!>fun foo()<!> {} // and here
|
||||
<!CONFLICTING_OVERLOADS!>fun foo()<!> {} // and here
|
||||
|
||||
<!CONFLICTING_OVERLOADS!>fun bar()<!> {} // and here
|
||||
<!CONFLICTING_OVERLOADS!>fun bar()<!> {} // and here
|
||||
<!CONFLICTING_OVERLOADS!>fun bar()<!> {} // and here
|
||||
}
|
||||
Reference in New Issue
Block a user