QuickFix: change type of overridden function to type of overridding function
This commit is contained in:
+12
@@ -0,0 +1,12 @@
|
||||
// "Change 'A.foo' function return type to 'Long'" "true"
|
||||
trait A {
|
||||
fun foo(): Long
|
||||
}
|
||||
|
||||
trait B {
|
||||
fun foo(): Number
|
||||
}
|
||||
|
||||
trait C : A, B {
|
||||
override fun foo(): Long<caret>
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
// "Change 'A.foo' function return type to 'Long'" "false"
|
||||
// ERROR: <html>Return type is 'jet.Long', which is not a subtype of overridden<br/><b>internal</b> <b>abstract</b> <b>fun</b> foo(): jet.Int <i>defined in</i> A</html>
|
||||
trait A {
|
||||
fun foo(): Int
|
||||
}
|
||||
|
||||
trait B {
|
||||
fun foo(): String
|
||||
}
|
||||
|
||||
trait C : A, B {
|
||||
override fun foo(): Long
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
// "Change 'A.foo' function return type to 'Long'" "true"
|
||||
trait A {
|
||||
fun foo(): Int
|
||||
}
|
||||
|
||||
trait B {
|
||||
fun foo(): Number
|
||||
}
|
||||
|
||||
trait C : A, B {
|
||||
override fun foo(): Long<caret>
|
||||
}
|
||||
Reference in New Issue
Block a user