Submission: switch (...) instanceof feature

brucechapman at paradise.net.nz brucechapman at paradise.net.nz
Sun Mar 29 15:47:52 PDT 2009


Quoting myself, who looks like they were sending an SMS message

> 3/ Your synthetic variable gives surprising results if <<identifier>>
> appears on
> the LHS of an assignment operator, because you will assign to the
> synthetic
> variable, not the obvious one. Solutions are to only allow identifiers
> declared
> "final" (and make the synthetic variable fine) OR don't use a synthetic
> variable
> and instead insert the case everywhere the identifier is used (except on
> LHS of
> assignment).
> 


should say

3/ Your synthetic variable gives surprising results if <<identifier>> appears on
the LHS of an assignment operator, because you will assign to the synthetic
variable, not the obvious one. Solutions are to only allow identifiers declared
"final" (and make the synthetic variable final) OR don't use a synthetic
variable and instead insert the cast everywhere the identifier is used (except
on LHS of assignment).

B  :)





More information about the coin-dev mailing list