[code-reflection] RFR: Review FieldLoadOp

Mourad Abbay mabbay at openjdk.org
Tue Feb 13 03:04:04 UTC 2024


On Mon, 12 Feb 2024 21:53:44 GMT, Mourad Abbay <mabbay at openjdk.org> wrote:

> Make sure FieldLoadOp is consistent with other reflective operations.

src/jdk.compiler/share/classes/com/sun/tools/javac/comp/ReflectMethods.java line 885:

> 883:                     } else {
> 884:                         FieldDesc fd = symbolToFieldDesc(sym, symbolSiteType(sym));
> 885:                         // @@@ for now, for field of generic type, result type is the upper bound

When we have an unqualified access to a field of generic type, I was expecting the type variable to be the result type of the field.load operation (or something that indicates the field is of generic type), but currently the result type is the upper bound of the type variable. Maybe in the new way modeling of types, we can have that.

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

PR Review Comment: https://git.openjdk.org/babylon/pull/19#discussion_r1487095812


More information about the babylon-dev mailing list