Community
Participate
Working Groups
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...
The position of the error are provided by JDT/Core. Moving...
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?
An assignment is a valid expression, and can thus be interpreted to be part of the conditional operator on the line above. Closing