RFR: 8370800: Downgrade cant.attach.type.annotations diagnostics to warnings [v3]

Liam Miller-Cushon cushon at openjdk.org
Thu Nov 6 11:32:35 UTC 2025


On Tue, 4 Nov 2025 08:07:12 GMT, Liam Miller-Cushon <cushon at openjdk.org> wrote:

> I wonder if a better approach here is to continue to report `cant.attach.type.annotations` as an unconditional error, but to defer the work down by `addTypeAnnotationsToSymbol` until the symbol is completed, instead of doing it unconditionally when annotations are completed after reading the class.

I have been doing some more testing with this and it seems to work. I adjusted the initial approach to ensure it's only deferring attaching type annotations to symbol completion for non-class members, classes are still completed eagerly, which has the desired behaviour for type annotations and also avoids interactions with how annotation processing resets completers for class symbols.

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

PR Comment: https://git.openjdk.org/jdk/pull/28018#issuecomment-3496706390


More information about the compiler-dev mailing list