RFR: 8334055: Unhelpful 'required: reference' diagnostics after JDK-8043226

Vicente Romero vromero at openjdk.org
Thu Jul 11 01:59:56 UTC 2024


On Wed, 12 Jun 2024 01:15:09 GMT, Liam Miller-Cushon <cushon at openjdk.org> wrote:

> Please consider this fix for [JDK-8334055: Unhelpful 'required: reference' diagnostics after JDK-8043226](https://bugs.openjdk.org/browse/JDK-8334055), which partially reverts some logic originally added by the fix for [JDK-8043226](https://bugs.openjdk.org/browse/JDK-8043226).
> 
> The core of JDK-8043226 is preserved, improved diagnostics are still reported where 'scoping construct cannot be annotated' diagnostics were emitted previously.
> 
> The reverted logic affects attribution of type annotations on package names, which was intended to enable better diagnostics, but also affected diagnostics for type annotations on missing symbols.
> 
> 
> CantAnnotateMissingSymbol.java:12: error: unexpected type
>     List<@TA NoSuch> x;
>          ^
>   required: reference
>   found:    NoSuch
> 
> 
> The restored behavior is:
> 
> 
> CantAnnotateMissingSymbol.java:12: error: cannot find symbol
>     List<@TA NoSuch> x;
>              ^
>   symbol:   class NoSuch
>   location: class CantAnnotateMissingSymbol

lgtm

-------------

Marked as reviewed by vromero (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/19667#pullrequestreview-2170726738


More information about the compiler-dev mailing list