Bug 64405 - showing the error indication at wrong place
Summary: showing the error indication at wrong place
Status: RESOLVED INVALID
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 3.0 RC2   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-05-27 13:54 EDT by Emerson Cargnin CLA
Modified: 2004-05-31 18:29 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Emerson Cargnin CLA 2004-05-27 13:54:01 EDT
The following code show the error at the second line (_codSituacao is
underlined), although with the message "insert : to complete the expression"

this.escopo="S".equalsIgnoreCase(ehAtiva)?
codSituacao=_codSituacao;

maybe it's not possible to the parser to know that codSituacao is not part of
the expression...
Comment 1 Dirk Baeumer CLA 2004-05-27 14:05:10 EDT
The position of the error are provided by JDT/Core. Moving...
Comment 2 Olivier Thomann CLA 2004-05-27 15:32:47 EDT
The question mark means that the expression is read as a conditional expression.
expr ? expr1 : expr2 

And indeed there is no colon (':'). The code is syntactically incorrect and in
this case the compiler tries to give a good error message according to the
parser rules. So codSituacao=_codSituacao is seen as expr1 in the syntax above.

Ok to close?
Comment 3 Philipe Mulet CLA 2004-05-31 18:29:26 EDT
An assignment is a valid expression, and can thus be interpreted to be part of 
the conditional operator on the line above.

Closing