RFR: JDK-8042981: Strip type annotations in Types' utility methods [v2]

Liam Miller-Cushon cushon at openjdk.org
Wed Jan 24 00:03:40 UTC 2024


On Tue, 23 Jan 2024 23:55:30 GMT, Jonathan Gibbons <jjg at openjdk.org> wrote:

>> src/java.compiler/share/classes/javax/lang/model/util/Types.java line 40:
>> 
>>> 38:  * Where a method returns a type mirror or a collection of type
>>> 39:  * mirrors, any type mirrors represent types with no type annotations,
>>> 40:  * unless otherwise indicated.
>> 
>> I'm seeing `erasure` preserve type annotations on the array type (but not its component) after this change: `erasure(@A int @B []) = int @B []`. (Here's the [repro](https://gist.github.com/cushon/e0a59cc291c3b83204b9139addb01340).)
>> 
>> Is that deliberate, or is this still work in progress?
>
> @jdarcy ?

(This comment is obsolete, it was on a much earlier version of the PR, and these issues have been addressed. The latest version correct handles removing annotations from contained types. There's some discussion about the issues with the earlier approach in https://github.com/openjdk/jdk/pull/8984#issuecomment-1806211798)

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

PR Review Comment: https://git.openjdk.org/jdk/pull/8984#discussion_r1464132270


More information about the compiler-dev mailing list