[patch] 6646584 Compound assignment with Byte, Short and Character
Alex Buckley
Alex.Buckley at Sun.COM
Mon Jan 7 14:39:09 PST 2008
There is already an RFE filed against the spec to allow these compound
assignments. Please see http://bugs.sun.com/view_bug.do?bug_id=5009476
which I have updated with an evaluation of why it might (or might not)
be a good idea.
Alex
Spec Lead, Java Language & VM
Rémi Forax wrote:
> Dmytro Sheyko a écrit :
>> Well...
>>
>> Is there any reason to reject following statement
>>
>> B += 1;
>>
>> where 'B' is a variable of wrapper type 'java.lang.Byte' and accept in
>> the same time following statements
>>
>> b += 1;
>> ++B;
>>
>> where 'b' a variable of primitive type 'int'? Of course, besides that
>> it is implied by JLS. I don't think that JLS was written so as
>> intentionally reject compound assignments with some wrapper types. And
>> current behavior seems inconsistent for me.
>>
>> If you like, this is RFE to JLS rather than bug in javac.
> yes, for me it's a bug of the JLS3.
>
> Rémi
More information about the compiler-dev
mailing list