[FIR] Bring conflicting overloads errors closer to K1 behavior

#KT-55860 Fixed
This commit is contained in:
Kirill Rakhman
2023-03-24 15:58:05 +01:00
committed by Space Team
parent 9dd778bc89
commit 56da3c2ee2
12 changed files with 124 additions and 28 deletions
@@ -1,7 +0,0 @@
open class Aaa() {
fun foo() = 1
}
open class Bbb() : Aaa() {
fun <T> foo() = 2
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
open class Aaa() {
fun foo() = 1
}
@@ -0,0 +1,31 @@
// SKIP_TXT
open class A {
fun <T> some(s: String): T = null!!
}
interface I {
fun some(text: String) = ""
}
open <!CONFLICTING_INHERITED_MEMBERS!>class X1<!> : A(), I
open <!CONFLICTING_INHERITED_MEMBERS!>class X2<!> : X1()
// for some reason no error in K1
open class B {
fun <T> some(s: String): T = null!!
fun some(text: String) = ""
}
open class X3 : B()
open class X4 : X3()
open class C {
fun <T> some(s: String): T = null!!
}
open class X5 : C() {
<!CONFLICTING_OVERLOADS!>fun some(text: String)<!> = ""
}
open <!CONFLICTING_INHERITED_MEMBERS!>class X6<!> : X5()
@@ -0,0 +1,31 @@
// SKIP_TXT
open class A {
fun <T> some(s: String): T = null!!
}
interface I {
fun some(text: String) = ""
}
open <!CONFLICTING_INHERITED_MEMBERS!>class X1<!> : A(), I
open class X2 : X1()
// for some reason no error in K1
open class B {
fun <T> some(s: String): T = null!!
fun some(text: String) = ""
}
open class X3 : B()
open class X4 : X3()
open class C {
fun <T> some(s: String): T = null!!
}
open class X5 : C() {
<!CONFLICTING_OVERLOADS!>fun some(text: String)<!> = ""
}
open class X6 : X5()
@@ -1,13 +0,0 @@
interface A {
fun <T> foo()
fun <T> bar()
}
interface B {
fun foo()
fun bar()
}
<!CONFLICTING_INHERITED_MEMBERS!>interface C1<!> : A, B {
override fun bar()
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
interface A {
fun <T> foo()
fun <T> bar()