[code-reflection] RFR: Add common supertype for type-variable owners

Maurizio Cimadamore mcimadamore at openjdk.org
Mon Apr 29 17:08:46 UTC 2024


On Mon, 29 Apr 2024 17:03:36 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

> This is a followup of https://git.openjdk.org/babylon/pull/64
> 
> The goal is to define a common supertype for type-variable owner, namely `Type>
> 
> This is a sealed interface implemented by both `MethodRef` and `ClassType`.

test/jdk/java/lang/reflect/code/TestErasure.java line 121:

> 119:         for (int dims = 1 ; dims <= 3 ; dims++) {
> 120:             for (TypeAndErasure t : references()) {
> 121:                 typeVars.add(new TypeAndErasure(JavaType.typeVarRef("X", (ClassType)JavaType.J_L_OBJECT, t.type), t.erasure));

I plan to sharpen the types of the various `JavaType` constants in a follow up PR where I'll also clean up the various type factories.

test/jdk/java/lang/reflect/code/type/TestJavaType.java line 132:

> 130:         Assert.assertEquals(jt.toString(), tds);
> 131: 
> 132:         while (jt instanceof ArrayType) {

This issue was missed in the previous PR somehow

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

PR Review Comment: https://git.openjdk.org/babylon/pull/66#discussion_r1583425812
PR Review Comment: https://git.openjdk.org/babylon/pull/66#discussion_r1583425219


More information about the babylon-dev mailing list