graph inference: conditional expressions then/else branches inference based on context (IDEA-100453)

This commit is contained in:
anna
2013-02-11 17:32:01 +01:00
parent b2ffa6a8d1
commit cc9724c489
3 changed files with 33 additions and 5 deletions
@@ -0,0 +1,16 @@
class Test<U> {
public Optional<U> bar(boolean empty, U state) {
Optional<U> o = empty ? Optional.empty() : Optional.of(state);
return empty ? Optional.empty() : Optional.empty();
}
static class Optional<T> {
public static <U> Optional<U> empty() {
return null;
}
public static <U> Optional<U> of(U state) {
return null;
}
}
}