Write nullability annotations on extension receiver parameters
#KT-5429 Fixed
This commit is contained in:
@@ -1,15 +1,17 @@
|
||||
<caret>import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.lang.Override;
|
||||
|
||||
public class J extends A {
|
||||
private int p;
|
||||
|
||||
@Override
|
||||
public int getP(String receiver) {
|
||||
public int getP(@NotNull String receiver) {
|
||||
return p;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setP(String receiver, int value) {
|
||||
public void setP(@NotNull String receiver, int value) {
|
||||
p = value;
|
||||
}
|
||||
}
|
||||
@@ -28,4 +30,4 @@ class Test {
|
||||
new B().getP("");
|
||||
new B().setP("", 3);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+6
-4
@@ -1,18 +1,20 @@
|
||||
<caret>import org.jetbrains.annotations.NotNull;
|
||||
|
||||
interface J<A> extends T<A> {
|
||||
@Override
|
||||
<B> int foofoofoo(U<A> a, B b);
|
||||
<B> int foofoofoo(@NotNull U<A> a, B b);
|
||||
}
|
||||
|
||||
abstract class J1<X> implements J<U<X>> {
|
||||
@Override
|
||||
public <C> int foofoofoo(U<U<X>> xu, C c) {
|
||||
public <C> int foofoofoo(@NotNull U<U<X>> xu, C c) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
}
|
||||
|
||||
abstract class J2 extends J1<String> {
|
||||
@Override
|
||||
public <C> int foofoofoo(U<U<String>> xu, C c) {
|
||||
public <C> int foofoofoo(@NotNull U<U<String>> xu, C c) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user