Bug 61189

Summary: Error messages with "AssignmentOperator ArrayInitializer" could be improved
Product: [Eclipse Project] JDT Reporter: David Audel <david_audel>
Component: CoreAssignee: David Audel <david_audel>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: markus.kell.r
Version: 3.0   
Target Milestone: 3.2 M6   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description David Audel CLA 2004-05-06 07:33:02 EDT
build 20040506

With the following test case

public class X {
	public void foo() {
		 (X) foo();
	}
}

the error messages are

Syntax error, insert ";" to complete BlockStatements
Syntax error, insert "AssignmentOperator ArrayInitializer" to complete 
ArrayInitializerAssignement

The corresponding grammar rule is
InvalidArrayInitializerAssignement ::= PostfixExpression AssignmentOperator 
ArrayInitializer

This rule exist to perform better diagnose for expression like
x = {0}

But it would not be suggested as possible correction.

(original bug is bug 12287)
Comment 1 Philipe Mulet CLA 2004-05-06 07:45:35 EDT
If this is resolved in 1.5 branch, I wouldn't worry about it for 3.0.
Comment 2 Olivier Thomann CLA 2004-05-06 09:22:05 EDT
I saw it yesterday in HEAD.
Code like this:
class X {
   void foo(int i) {
       i;
   }
}

produces the same error.
Comment 3 Frederic Fusier CLA 2004-06-21 11:32:07 EDT
deferred post 3.0
Comment 4 David Audel CLA 2006-02-28 12:01:36 EST
reopen
Comment 5 David Audel CLA 2006-02-28 12:02:00 EST
Fixed and tests added
  SyntaxErrorTest#test05() -> test06()

Updated tests
  ComplianceDiagnoseTests
  ParserTest
Comment 6 Olivier Thomann CLA 2006-03-28 09:58:45 EST
Verified using I20060328-0010 for 3.2M6
Comment 7 David Audel CLA 2006-03-29 05:32:24 EST
*** Bug 112542 has been marked as a duplicate of this bug. ***