instanceof has higher precedence than assignment, but if a instanceof b then that compiles to if(that = a instanceof b) {that;}. In my mind, I'd prefer that to point to a, rather than the result of the instanceof. Is the current compilation correct behaviour?
Edit: to me, it should be consistent with the existing if a? then that → if((that = a) != null){that;}.
instanceof
has higher precedence than assignment, butif a instanceof b then that
compiles toif(that = a instanceof b) {that;}
. In my mind, I'd preferthat
to point toa
, rather than the result of theinstanceof
. Is the current compilation correct behaviour?Edit: to me, it should be consistent with the existing
if a? then that
→if((that = a) != null){that;}
.