diagnostics for non-applicable type annotations
Liam Miller-Cushon
cushon at google.com
Fri May 3 17:05:02 UTC 2024
Thanks! I have updated the PR with the 'not expected here' language.
On Fri, May 3, 2024 at 1:52 AM Maurizio Cimadamore <
maurizio.cimadamore at oracle.com> wrote:
>
> On 02/05/2024 19:17, Liam Miller-Cushon wrote:
>
> Thanks Maurizio,
>>
>> * can this error only be issues when there is a bad type annotation in a
>> qualified type? If not, then the latter part of the message might be
>> reaching too far
>>
> That is the intent. The diagnostic should only be emitted on a
> JCAnnotatedType if the name is qualified and the type can be resolved, and
> if the annotations are type annotations.
>
> Thanks for the explanation!
>
> * in other places we have messages like "XYZ not expected here" - perhaps
>> might be useful to provide more consistent diagnostics
>> * Not sure about seeing @TA in the error message after "locaton: " - in
>> the sense that the message seems to suggest that what's coming next (after
>> the colon) is a location, not the actual annotation?
>>
> Thanks, great points. Perhaps showing the specific annotations inline
> would be clearer, combined with the 'not expected here' language that could
> result in something like:
>
> type annotation @TA is not expected here
>
> Yes, that would address my concern.
>
> Cheers
> Maurizio
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/compiler-dev/attachments/20240503/4d711d60/attachment-0001.htm>
More information about the compiler-dev
mailing list