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:
@@ -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>
|
||||
}
|
||||
+7
@@ -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>
|
||||
}
|
||||
+9
@@ -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>
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user