mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 15:27:45 +07:00
Fix precise type calculation for try-with-resources
This commit is contained in:
+19
-1
@@ -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>
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user