/* * @test /nodynamiccopyright/ * @bug 6911256 6964740 6965277 * @author Maurizio Cimadamore * @summary Resource of an intersection type crashes Flow * @compile ArmIntersection.java */ interface MyCloseable extends AutoCloseable { void close() throws java.io.IOException; } class ResourceTypeVar { public void test() { try(getX()) { //do something } catch (java.io.IOException e) { // Not reachable throw new AssertionError("Shouldn't reach here", e); } } X getX() { return null; } }