RFR: JDK-8236544: Confusing javac message: return type of accessor method abc() is not compatible with type of record component number

Vicente Romero vicente.romero at oracle.com
Fri Jan 3 15:56:21 UTC 2020


Hi Maurizio,

Thanks for the review, I will update the patch accordingly before pushing,

Vicente

On 1/2/20 8:26 PM, Maurizio Cimadamore wrote:
>
> Looks good - consider flipping from negative to positive, and 
> replacing "identical" with "match", as in:
>
> "return type of accessor method {0} must match the type of record 
> component {1}"
>
> If you go down this path, I see this other key that uses related 
> wording (and you might update that to, to use 'match'):
>
> 3501 compiler.misc.type.must.be.identical.to.corresponding.record.component.type=\
> 3502     type must be identical to corresponding record component type\
>
> e.g.
>
> "type must match that of the corresponding record component"
>
> (bringing this up because the "identical" word appears nowhere else in 
> the javac error messages)
>
> Maurizio
>
> On 02/01/2020 19:42, Vicente Romero wrote:
>> Hi,
>>
>> Please review this very simple change to an error message related to 
>> records. The patch makes the error message more specific as the spec 
>> doesn't allow an accessor method to declare a return type other than 
>> the same declared by the corresponding record component. The current 
>> error message is referring to compatibility between types instead of 
>> exact match which is what the spec allows,
>>
>> Thanks,
>> Vicente
>>
>> http://cr.openjdk.java.net/~vromero/8236544/webrev.00/
>> https://bugs.openjdk.java.net/browse/JDK-8236544

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/compiler-dev/attachments/20200103/0f75fe12/attachment.htm>


More information about the compiler-dev mailing list