Fix precise type calculation for try-with-resources

This commit is contained in:
Roman Shevchenko
2012-10-30 17:01:05 +01:00
parent b9e861fc47
commit 7111f4ff4f
5 changed files with 133 additions and 105 deletions
@@ -156,7 +156,7 @@ class C {
}
}
void m11() throws E1 {
void m11() {
try {
System.out.println();
}
@@ -165,4 +165,22 @@ class C {
<error descr="Unhandled exception: java.lang.Exception">throw e;</error>
}
}
static class MyResource implements AutoCloseable {
public void close() throws E1 { }
}
MyResource getResource() throws E2 {
return null;
}
void m12() {
try (MyResource r = getResource()) {
System.out.println(r);
}
catch (Exception e) {
// test for another precise types calculation fix
<error descr="Unhandled exceptions: C.E1, C.E2">throw e;</error>
}
}
}