Bug 1362 : Error compiling when 'new' is first word in an 'else' block
Last modified: 2010-03-15 14:44




Status:
RESOLVED
Resolution:
FIXED -
Priority:
P4
Severity:
normal

 

Reporter:
jnz
Assigned To:
fry

Attachment Type Created Size Actions

Description:   Opened: 2009-10-27 17:18
This fails to compile:
if (true) {} else { new String(); }
with the error:
Syntax error on token "}", { expected after this token

But these all work:
if (true) {} else new String();
if (true) { new String(); } else {}
if (true) {} else { String x = new String(); }
int y; if (true) {} else { y = 0; new String(); }
if (true) {} else { int z; new String(); }
try {} finally { new String(); }
Additional Comment #1 From fry 2010-02-16 12:35
*** Bug 1377 has been marked as a duplicate of this bug. ***
Additional Comment #2 From fry 2010-02-17 20:44
k, added to the preprocessor bugs list.
Additional Comment #3 From MrFeinberg 2010-03-15 09:51
Fixed; please test and confirm.
Additional Comment #4 From fry 2010-03-15 14:44
verified fixed by jdf for 0180.