Resolve in resource list tuned to not look forward

This commit is contained in:
Roman Shevchenko
2011-02-25 20:59:19 +01:00
parent b2ec3c9263
commit a469762b6d
2 changed files with 14 additions and 4 deletions
@@ -46,11 +46,11 @@ class C {
}
<error descr="Cannot resolve symbol 'r'">r</error> = null;
try (MyResource <error descr="Variable 'r' is already defined in the scope">r</error> = new MyResource(); MyResource <error descr="Variable 'r' is already defined in the scope">r</error> = new MyResource()) { }
try (MyResource r = new MyResource(); MyResource <error descr="Variable 'r' is already defined in the scope">r</error> = new MyResource()) { }
try (MyResource r1 = new MyResource(); MyResource r2 = r1) { }
/* todo: try (MyResource r1 = < error descr="Cannot resolve symbol 'r'">r2</error >; MyResource r2 = r1) { }*/
try (MyResource r1 = <error descr="Cannot resolve symbol 'r2'">r2</error>; MyResource r2 = r1) { }
MyResource r = null;
try (MyResource <error descr="Variable 'r' is already defined in the scope">r</error> = new MyResource()) { }
@@ -64,4 +64,9 @@ class C {
}
}.run();
}
void m4() throws Exception {
MyResource r;
try (MyResource r1 = <error descr="Variable 'r' might not have been initialized">r</error>) { }
}
}