RFR: 8332507: compilation result depends on compilation order [v3]

Maurizio Cimadamore mcimadamore at openjdk.org
Fri May 31 11:56:02 UTC 2024


On Tue, 28 May 2024 15:25:31 GMT, Vicente Romero <vromero at openjdk.org> wrote:

>> Wildcards and separate compilation haven't been friends since like: forever. Javac has had a long standing issue of not being able to restore wildcard bounds when they are read from the classfile. Part of this is due to a restriction of not reading another class file while a given class file is being read. Without breaking this restriction we can "wait" until a class symbol is completed from a class file to have access to richer information and being able to set the right bounds to wildcards. The fix seems simple enough. Basically the proposal is to register listeners that will be invoked once a given class symbol is completely read from a class file. This tactic has been used in type inference and other areas of the compiler where another layer of indirection has been a must to fix similar problems.
>> 
>> It will be a great pleasure if this proposal can be the solution to this long standing issue,
>> 
>> TIA
>
> Vicente Romero has updated the pull request incrementally with one additional commit since the last revision:
> 
>   removing unused imports

Looks good - I left an optional suggestion

src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassReader.java line 599:

> 597:                         actuals = formals;
> 598:                     else
> 599:                         updateBounds(actuals, formals);

Is it important we do this here - or can we always do this in the completer (to simplify the code some more)

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

Marked as reviewed by mcimadamore (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/19400#pullrequestreview-2090658398
PR Review Comment: https://git.openjdk.org/jdk/pull/19400#discussion_r1622315749


More information about the compiler-dev mailing list