-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
8332507: compilation result depends on compilation order #19400
8332507: compilation result depends on compilation order #19400
Conversation
👋 Welcome back vromero! A progress list of the required criteria for merging this PR into |
@vicente-romero-oracle This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 164 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. ➡️ To integrate this PR with the above commit message to the |
@vicente-romero-oracle The following label will be automatically applied to this pull request:
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command. |
Webrevs
|
} | ||
if (actuals.length() != (formals == null ? 0 : formals.length())) { | ||
final List<Type> actualsCp = actuals; | ||
addSymbolReadListener(t, () -> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we could use the completion mechanism for this - class reader should already sign itself up as a completer for the class symbols it generates?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we could use the completion mechanism for this - class reader should already sign itself up as a completer for the class symbols it generates?
pretty good suggestion, thanks! I have uploaded another iteration that leverages the completer mechanism
if (actuals.isEmpty()) | ||
actuals = formals; | ||
else | ||
updateBounds(actuals, formals); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it important we do this here - or can we always do this in the completer (to simplify the code some more)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for the suggestion, will give it a try
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good - I left an optional suggestion
|
||
@Override | ||
public List<Type> getTypeArguments() { | ||
List<Type> formalsCp = ((ClassType)t.type.tsym.type).typarams_field; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works. You might use another boolean flag up top to say whether you actually need to adjust the type arguments (which is only needed the first time) ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure sorry I forgot about that, done
/integrate |
Going to push as commit e650bdf.
Your commit was automatically rebased without conflicts. |
@vicente-romero-oracle Pushed as commit e650bdf. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
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
Progress
Warning
8332507: compilation result depends on compilation order
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/19400/head:pull/19400
$ git checkout pull/19400
Update a local copy of the PR:
$ git checkout pull/19400
$ git pull https://git.openjdk.org/jdk.git pull/19400/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 19400
View PR using the GUI difftool:
$ git pr show -t 19400
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/19400.diff
Webrev
Link to Webrev Comment