[FIR] Support diagnostic QUALIFIED_SUPERTYPE_EXTENDED_BY_OTHER_SUPERTYPE

This commit is contained in:
Nick
2020-04-20 01:46:29 +03:00
committed by Dmitriy Novozhilov
parent 7a928dfed2
commit 96238cbe1f
14 changed files with 222 additions and 62 deletions
@@ -1,19 +0,0 @@
interface IBase<T> {
fun foo() {}
fun bar() {}
}
interface IDerived<T> : IBase<T> {
override fun foo() {}
fun qux() {}
}
class Test : IDerived<String>, IBase<String> {
fun test() {
super<IBase>.foo()
super<IBase>.bar()
super<IDerived>.foo()
super<IDerived>.bar()
super<IDerived>.qux()
}
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
interface IBase<T> {
fun foo() {}
fun bar() {}
@@ -1,29 +0,0 @@
interface IBase {
fun foo() {}
fun bar() {}
}
interface IDerived1 : IBase {
override fun foo() {}
fun qux() {}
}
interface IDerived2 : IBase {
override fun foo() {}
}
class Test : IDerived1, IBase, IDerived2 {
override fun foo() {}
fun test() {
super<IBase>.foo()
super<IBase>.bar()
super<IDerived1>.foo()
super<IDerived1>.bar()
super<IDerived1>.qux()
super<IDerived2>.foo()
super<IDerived2>.bar()
}
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
interface IBase {
fun foo() {}
fun bar() {}
@@ -20,7 +20,7 @@ class TestSuperForBase : B() {
typealias MyBase = B
override fun foo() {
<!NOT_A_SUPERTYPE!>super<Base><!>.foo()
super<Base>.foo()
super<B>.foo()
super<MyBase>.<!UNRESOLVED_REFERENCE!>foo<!>()
super<U>.foo()
@@ -32,7 +32,7 @@ class TestSuperForGenericBase<T> : GB<T>() {
typealias MyBaseInt = GB<Int>
override fun foo() {
<!NOT_A_SUPERTYPE!>super<GenericBase><!>.foo()
super<GenericBase>.foo()
super<GB>.foo()
super<MyBase>.<!UNRESOLVED_REFERENCE!>foo<!>()
super<MyBaseInt>.<!UNRESOLVED_REFERENCE!>foo<!>() // Type arguments don't matter here