blob: 762e57ef258805037a8b85fa5543c961699f4f35 [file] [log] [blame]
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
class Npe {
@NotNull Object aField;
@Nullable Object nullable() {
return null;
}
void bar() {
Object o = nullable();
aField = <warning descr="Expression 'o' might evaluate to null but is assigned to a variable that is annotated with @NotNull">o</warning>;
@NotNull Object aLocalVariable = o;
}
void bar2() {
Object o = nullable();
@NotNull Object aLocalVariable = <warning descr="Expression 'o' might evaluate to null but is assigned to a variable that is annotated with @NotNull">o</warning>;
aField = o;
}
}