IDEA-30498 Nullability not checked in initializer for static field

This commit is contained in:
peter
2012-10-31 20:06:45 +01:00
parent 4597c34cf2
commit 88a4de0b53
4 changed files with 31 additions and 8 deletions
@@ -0,0 +1,13 @@
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
class Foo {
@Nullable static Object foo() { return null; }
static String bar(@NotNull Object arg) { return ""; }
}
class Bar {
public static final String s = Foo.bar(<warning descr="Argument 'Foo.foo()' might be null">Foo.foo()</warning>);
@NotNull public static Object o = <warning descr="Expression 'Foo.foo()' might evaluate to null but is assigned to a variable that is annotated with @NotNull">Foo.foo()</warning>;
}