RFR: 8357653: Inner classes of type parameters emitted as raw types in signatures [v13]

Maurizio Cimadamore mcimadamore at openjdk.org
Thu Jul 10 12:34:45 UTC 2025


On Thu, 10 Jul 2025 12:22:06 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

>> Aggelos Biboudis has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Update comments
>
> src/jdk.compiler/share/classes/com/sun/tools/javac/code/Types.java line 2285:
> 
>> 2283:      * @param nextType a unary operator that emits the next type to be examined
>> 2284:      */
>> 2285:     public Type asSuperClosure(Type t, Symbol sym, UnaryOperator<Type> nextType) {
> 
> Thinking more about naming -- javac is using the term `closure` typically to denote method that return a "bag of stuff" (e.g. transitive _closure_ of supertypes, members, etc.). Here `closure` doesn't mean really that, so I'm having second thoughts :-(

It also occurred to me that this `asSuperClosure` we're trying to add can be expressed using streams (I think):


Type input = ...
UnaryFunction<Type> updateFunction = ...
Function<Type, Type> mapFunction = ...

Stream.iterate(input, updateFunction)
      .map(mapFunction)
      .filter(site -> !site.hasTag(NONE))
      .findFirst();


Where `mapFunction` is `asSuper(t, sym)`, and `updateFunction` differs, depending on whether we want `asEnclosingSuper` or `asOuterSuper`.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/25451#discussion_r2197603672


More information about the compiler-dev mailing list