Bug 61189 - Error messages with "AssignmentOperator ArrayInitializer" could be improved
Summary: Error messages with "AssignmentOperator ArrayInitializer" could be improved
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.2 M6   Edit
Assignee: David Audel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 112542 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-05-06 07:33 EDT by David Audel CLA
Modified: 2006-03-29 05:32 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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. ***