[FIR] Report conflicts for constructors of top-level classes

^KT-59880
This commit is contained in:
Nikolay Lunyak
2023-10-10 14:35:39 +03:00
committed by Space Team
parent bc2eb546b4
commit 09436d0480
6 changed files with 20 additions and 33 deletions
@@ -1,5 +1,5 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
open class B(x: Int)
<!SUPERTYPE_INITIALIZED_WITHOUT_PRIMARY_CONSTRUCTOR!>class A : B(1) {
constructor(): super(1)
<!SUPERTYPE_INITIALIZED_WITHOUT_PRIMARY_CONSTRUCTOR!>class <!CONFLICTING_OVERLOADS!>A<!> : B(1) {
<!CONFLICTING_OVERLOADS!>constructor()<!>: super(1)
}<!>
@@ -1,27 +0,0 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
class A(x: String = "", y: String = "") {
constructor(x: String, y: String): <!OVERLOAD_RESOLUTION_AMBIGUITY!>this<!>(x, y)
constructor(): <!OVERLOAD_RESOLUTION_AMBIGUITY!>this<!>("", "")
constructor(): <!OVERLOAD_RESOLUTION_AMBIGUITY!>this<!>("", "")
}
class B {
<!CONFLICTING_OVERLOADS!>constructor(x: Int)<!>
}
<!CONFLICTING_OVERLOADS!>fun B(x: Int)<!> {}
class Outer {
class A<!CONFLICTING_OVERLOADS!>(x: String = "", y: String = "")<!> {
<!CONFLICTING_OVERLOADS!>constructor(x: String, y: String)<!>: <!OVERLOAD_RESOLUTION_AMBIGUITY!>this<!>(x, y)
<!CONFLICTING_OVERLOADS!>constructor()<!>: <!OVERLOAD_RESOLUTION_AMBIGUITY!>this<!>("", "")
<!CONFLICTING_OVERLOADS!>constructor()<!>: <!OVERLOAD_RESOLUTION_AMBIGUITY!>this<!>("", "")
}
class B {
<!CONFLICTING_OVERLOADS!>constructor(x: Int)<!>
}
<!CONFLICTING_OVERLOADS!>fun B(x: Int)<!> {}
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// !DIAGNOSTICS: -UNUSED_PARAMETER
class A<!CONFLICTING_OVERLOADS!>(x: String = "", y: String = "")<!> {