QuickFix: change type of overridden function to type of overridding function

This commit is contained in:
Wojciech Lopata
2013-05-15 23:02:36 +02:00
parent e08d9ee8da
commit 16d9abf546
5 changed files with 89 additions and 9 deletions
@@ -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>
}
@@ -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
}
@@ -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>
}