Redundant override inspection: don't report for ambiguous derivation
#KT-24405 Fixed #KT-25883 Fixed
This commit is contained in:
+13
@@ -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()
|
||||
}
|
||||
Reference in New Issue
Block a user