Redundant override inspection: don't report for ambiguous derivation

#KT-24405 Fixed
#KT-25883 Fixed
This commit is contained in:
Mikhail Glukhikh
2018-09-04 15:45:26 +03:00
parent 607392a2ab
commit dead2516c2
7 changed files with 105 additions and 17 deletions
@@ -0,0 +1,13 @@
// PROBLEM: none
abstract class AbstractClass {
abstract fun foo(): Int
}
interface Interface {
fun foo(): Int = 3
}
class ChildClass : AbstractClass(), Interface {
override <caret>fun foo() = super.foo()
}
@@ -0,0 +1,10 @@
// PROBLEM: none
// WITH_RUNTIME
interface Foo {
fun add(i: Int): Boolean
}
class Bar: ArrayList<Int>(), Foo {
override <caret>fun add(i: Int) = super.add(i)
}
@@ -0,0 +1,11 @@
open class Class {
open fun foo(): Int = 4
}
interface Interface {
fun foo(): Int
}
class ChildClass : Class(), Interface {
override <caret>fun foo() = super.foo()
}
@@ -0,0 +1,10 @@
open class Class {
open fun foo(): Int = 4
}
interface Interface {
fun foo(): Int
}
class ChildClass : Class(), Interface {
}
@@ -0,0 +1,13 @@
// PROBLEM: none
interface Foo {
fun test()
}
interface Gav {
fun test() {}
}
class TwoInterfaces : Foo, Gav {
override <caret>fun test() = super.test()
}