Override/Implement: Prefer not-nullable return type when overriding Java method without nullability annotation
#KT-12381 Fixed (cherry picked from commit 2b87f8e)
This commit is contained in:
+1
-1
@@ -2,7 +2,7 @@ import foo.A
|
||||
import foo.B
|
||||
|
||||
class C : A() {
|
||||
override fun foo(x: MutableList<Any?>?, y: String?): B<*>? {
|
||||
override fun foo(x: MutableList<Any?>?, y: String?): B<*> {
|
||||
<selection><caret>throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.</selection>
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
import foo.Intf
|
||||
|
||||
class Impl(): Intf {
|
||||
override fun getFooBar(): String? {
|
||||
override fun getFooBar(): String {
|
||||
<selection><caret>throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.</selection>
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@ package foo
|
||||
import foo.Intf
|
||||
|
||||
class Impl(): Intf() {
|
||||
override fun getFooBar(): String? {
|
||||
override fun getFooBar(): String {
|
||||
<selection><caret>return super.getFooBar()</selection>
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -3,7 +3,7 @@ package foo
|
||||
import foo.Intf
|
||||
|
||||
class Impl(): Intf() {
|
||||
override fun getFooBar(): String? {
|
||||
override fun getFooBar(): String {
|
||||
<selection><caret>return super.getFooBar()</selection>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
package foo;
|
||||
|
||||
public class A {
|
||||
public 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>
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user