mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
dfa: overriding @NotNull has precedence over super method @Nullable
This commit is contained in:
@@ -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());
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user