Skip to content
This repository has been archived by the owner on Sep 2, 2022. It is now read-only.

8258972: unexpected compilation error with generic sealed interface #72

Closed

Conversation

vicente-romero-oracle
Copy link

@vicente-romero-oracle vicente-romero-oracle commented Dec 29, 2020

Hi,

Please review this fix to the implementation of section 5.1.6.1 Allowed Narrowing Reference Conversion of the Sealed Classes spec 1. IMO the compiler was not implementing the spec to the letter in particular the inheritance relation between a sealed class and a subclass should be tested ignoring type arguments which is what this patch is doing. Comments?

Thanks,
Vicente


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

  • JDK-8258972: unexpected compilation error with generic sealed interface

Reviewers

Download

$ git fetch https://git.openjdk.java.net/jdk16 pull/72/head:pull/72
$ git checkout pull/72

@bridgekeeper
Copy link

bridgekeeper bot commented Dec 29, 2020

👋 Welcome back vromero! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk openjdk bot added the rfr Pull request is ready for review label Dec 29, 2020
@openjdk
Copy link

openjdk bot commented Dec 29, 2020

@vicente-romero-oracle The following label will be automatically applied to this pull request:

  • compiler

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.

@openjdk openjdk bot added the compiler compiler-dev@openjdk.java.net label Dec 29, 2020
@mlbridge
Copy link

mlbridge bot commented Dec 29, 2020

Webrevs

@@ -1667,7 +1667,7 @@ public boolean isCastable(Type t, Type s, Warner warn) {
}
// where
private boolean areDisjoint(ClassSymbol ts, ClassSymbol ss) {
if (isSubtype(ts.type, ss.type)) {
if (isSubtype(erasure(ts.type), erasure(ss.type))) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is another isSubtype below - could you please check if it needs the same erasure handling?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, done

Copy link
Contributor

@lahodaj lahodaj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@openjdk
Copy link

openjdk bot commented Jan 7, 2021

@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:

8258972: unexpected compilation error with generic sealed interface

Reviewed-by: jlahoda

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 18 new commits pushed to the master branch:

  • 484e23b: 8258657: Doc build is broken by use of new language features
  • 4a478b8: 8250903: jdk/jfr/javaagent/TestLoadedAgent.java fails with Mismatch in TestEvent count
  • 4f914e2: 8249633: doclint reports missing javadoc for JavaFX property methods that have a property description
  • eef43be: 8251200: False positive messages about missing comments for serialization
  • f1bc4e0: 8259312: VerifyCACerts.java fails as soneraclass2ca cert will expire in 90 days
  • 4a5786b: 8259075: Update the copyright notice in the files generated by CLDR Converter tool
  • d25a1be: 8259224: (ann) getAnnotatedReceiverType should not parameterize owner(s) of statically nested classes
  • ad45678: 8258558: Revert changes for JDK-8252505 and related issues
  • e66187d: 8259032: MappedMemorySegmentImpl#makeMappedSegment() ignores Unmapper#pagePosition
  • 80110da: 8259007: This test printed a blank page
  • ... and 8 more: https://git.openjdk.java.net/jdk16/compare/73f5415363232804bd1904c1a80b0a724eabe63f...master

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 master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Jan 7, 2021
@vicente-romero-oracle
Copy link
Author

/integrate

@openjdk openjdk bot closed this Jan 7, 2021
@openjdk openjdk bot added integrated Pull request has been integrated and removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Jan 7, 2021
@openjdk
Copy link

openjdk bot commented Jan 7, 2021

@vicente-romero-oracle Since your change was applied there have been 19 commits pushed to the master branch:

  • c1fb521: 8259227: C2 crashes with SIGFPE due to a division that floats above its zero check
  • 484e23b: 8258657: Doc build is broken by use of new language features
  • 4a478b8: 8250903: jdk/jfr/javaagent/TestLoadedAgent.java fails with Mismatch in TestEvent count
  • 4f914e2: 8249633: doclint reports missing javadoc for JavaFX property methods that have a property description
  • eef43be: 8251200: False positive messages about missing comments for serialization
  • f1bc4e0: 8259312: VerifyCACerts.java fails as soneraclass2ca cert will expire in 90 days
  • 4a5786b: 8259075: Update the copyright notice in the files generated by CLDR Converter tool
  • d25a1be: 8259224: (ann) getAnnotatedReceiverType should not parameterize owner(s) of statically nested classes
  • ad45678: 8258558: Revert changes for JDK-8252505 and related issues
  • e66187d: 8259032: MappedMemorySegmentImpl#makeMappedSegment() ignores Unmapper#pagePosition
  • ... and 9 more: https://git.openjdk.java.net/jdk16/compare/73f5415363232804bd1904c1a80b0a724eabe63f...master

Your commit was automatically rebased without conflicts.

Pushed as commit acdd90b.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
compiler compiler-dev@openjdk.java.net integrated Pull request has been integrated
2 participants