dfa: overriding @NotNull has precedence over super method @Nullable

This commit is contained in:
peter
2015-04-13 18:51:22 +03:00
parent 3583e28000
commit ecab324ae0
4 changed files with 40 additions and 6 deletions
@@ -0,0 +1,26 @@
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.lang.Object;
import java.lang.Override;
class Super {
@Nullable Object foo() {
return null;
}
}
class Main extends Super {
@NotNull
@Override
Object foo() {
return 2;
}
void bar(@NotNull Object o) {}
void goo() {
bar(foo());
}
}