Fix 'Redundant override' when delegated member hides super type override

So #KT-20231 Fixed
This commit is contained in:
Toshiaki Kameyama
2017-10-02 10:32:07 +03:00
committed by Mikhail Glukhikh
parent 3daee25ce8
commit bbb571260b
8 changed files with 135 additions and 1 deletions
@@ -0,0 +1,14 @@
// PROBLEM: none
interface Foo {
fun test(arg: String)
}
open class Bar : Foo {
override fun test(arg: String) {}
open fun test(a: Int) {}
open fun test2() {}
}
class Baz(val foo: Foo) : Bar(), Foo by foo {
override <caret>fun test(arg: String) = super.test(arg)
}
@@ -0,0 +1,18 @@
// PROBLEM: none
interface A
interface B {
fun test(arg: String)
}
interface Foo : A, B
open class Bar : Foo {
override fun test(arg: String) {}
open fun test(a: Int) {}
open fun test2() {}
}
class Baz(val foo: Foo) : Bar(), Foo by foo {
override <caret>fun test(arg: String) = super.test(arg)
}
@@ -0,0 +1,13 @@
interface Foo {
fun test(arg: Int)
}
open class Bar : Foo {
override fun test(arg: Int) {}
open fun test(a: String) {}
open fun test2() {}
}
class Baz(val foo: Foo) : Bar(), Foo by foo {
override <caret>fun test(a: String) = super.test(a)
}
@@ -0,0 +1,12 @@
interface Foo {
fun test(arg: Int)
}
open class Bar : Foo {
override fun test(arg: Int) {}
open fun test(a: String) {}
open fun test2() {}
}
class Baz(val foo: Foo) : Bar(), Foo by foo {
}
@@ -0,0 +1,13 @@
interface Foo {
fun test(arg: Int)
}
open class Bar : Foo {
override fun test(arg: Int) {}
open fun test(a: String) {}
open fun test2() {}
}
class Baz(val foo: Foo) : Bar(), Foo by foo {
override <caret>fun test2(arg: Int) = super.test2(arg)
}
@@ -0,0 +1,12 @@
interface Foo {
fun test(arg: Int)
}
open class Bar : Foo {
override fun test(arg: Int) {}
open fun test(a: String) {}
open fun test2() {}
}
class Baz(val foo: Foo) : Bar(), Foo by foo {
}