Override/Implement Members: Do not make return type non-nullable if base

return type is explicitly nullable
 #KT-13383 Fixed
 #KT-13379 Fixed
This commit is contained in:
Alexey Sedunov
2016-08-08 18:14:54 +03:00
parent 75573bd6a5
commit 1a4ff598e3
8 changed files with 54 additions and 1 deletions
@@ -0,0 +1,9 @@
package foo;
import org.jetbrains.annotations.Nullable;
public class A {
public @Nullable String foo(String s) {
return null;
}
}
@@ -0,0 +1,5 @@
import foo.A
class B : A() {
<caret>
}
@@ -0,0 +1,7 @@
import foo.A
class B : A() {
override fun foo(s: String?): String? {
<selection><caret>return super.foo(s)</selection>
}
}
@@ -0,0 +1,7 @@
interface IBase {
fun foo(): Any?
}
class C : IBase {
<caret>
}
@@ -0,0 +1,9 @@
interface IBase {
fun foo(): Any?
}
class C : IBase {
override fun foo(): Any? {
<selection><caret>TODO("not implemented") //To change body of created functions use File | Settings | File Templates.</selection>
}
}