IDEA-164159 Nullability annotations don't work with generics

This commit is contained in:
peter
2016-11-21 16:41:08 +01:00
parent 53a517d779
commit 103feba4ca
4 changed files with 22 additions and 1 deletions
@@ -0,0 +1,17 @@
import org.jetbrains.annotations.NotNull;
abstract class Foo {
@NotNull
abstract <T> T get(@NotNull Class<? extends T> type);
void foo(Field field) {
Object value = get(field.getType());
if (<warning descr="Condition 'value != null' is always 'true'">value != null</warning>) {
}
}
}
interface Field {
Class<?> getType();
}