|
Re: Arrays Now Break Code Check [message #1733514 is a reply to message #1733509] |
Sun, 29 May 2016 10:32 |
Stephan Herrmann Messages: 1853 Registered: July 2009 |
Senior Member |
|
|
Rick S wrote on Sun, 29 May 2016 06:15Arrays now cause bugs ...
No, there's no bug in JDT, and it's not the array that causes the error.
You are trying to implement statements in a position where Java does not admit statements.
The first line, is OK, this is a field declaration with initialization.
The second line, is a statement, this is illegal outside of method bodies and class/instance initializers. The solution is to put this statement into a new initializer, s.t. like this:
int[] x = new int[5];
{ // this starts an instance initializer
x[0] = 1;
}
I admit that the error is raised at a suboptimal location, but then note that it says: "{ expected after this token" to signal that something is syntactically wrong after the semicolon.
best,
Stephan
PS: btw, indigo is quite old, you should really consider updating to a recent version of Eclipse, you are missing out on 4 years worth of bug fixes and enhancements.
|
|
|
Powered by
FUDForum. Page generated in 0.03660 seconds