inference: ensure to convert disjunction type to lub (IDEA-150364)

This commit is contained in:
Anna Kozlova
2016-01-14 16:18:20 +01:00
parent 2255d1571f
commit ae64c30eb9
3 changed files with 34 additions and 1 deletions
@@ -0,0 +1,25 @@
class Test {
public static void main(String[] args) throws Exception {
try {
}
catch (Exception | Error e) {
<error descr="Unhandled exception: java.lang.Throwable">throw identity(identity(e));</error>
}
try {
}
catch (Exception | Error e) {
<error descr="Unhandled exception: java.lang.Throwable">throw identity(e);</error>
}
try {
}
catch (Exception | Error e) {
throw e;
}
}
public static <T> T identity(T throwable) {
return throwable;
}
}