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

Liam Miller-Cushon cushon at openjdk.org
Thu Jul 11 19:57:07 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

This pull request has now been integrated.

Changeset: 9eb611e7
Author:    Liam Miller-Cushon <cushon at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/9eb611e7f07ebb6eb0cbcca32d644abf8352c991
Stats:     41 lines in 7 files changed: 23 ins; 13 del; 5 mod

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

Reviewed-by: vromero

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

PR: https://git.openjdk.org/jdk/pull/19667


More information about the compiler-dev mailing list