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

Liam Miller-Cushon cushon at openjdk.org
Wed Jul 10 20:28:47 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

bridgekeeper please keep this open

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

PR Comment: https://git.openjdk.org/jdk/pull/19667#issuecomment-2221348786


More information about the compiler-dev mailing list