Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-11292

Class without sealed parent cannot be non-sealed

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 5.0.0-alpha-6
    • None
    • None

    Description

      A (java, sealed)
      ^
      |
      B (java, non-sealed)
      ^
      |
      C (groovy)
      

      Error "cannot be non-sealed as it has no sealed parent" will occur while compiling the class C.

      Java 19+ build fails because of the bug:

      startup failed:
      /home/daniel/IdeaProjects/groovy/src/test/org/codehaus/groovy/util/ReferenceManagerTest.groovy: 147: The class 'org.codehaus.groovy.util.ReferenceManagerTest$TestReference' cannot be non-sealed as it has no sealed parent.
       @ line 147, column 13.
             private class TestReference<T>
                     ^
      1 error
      > Task :compileTestGroovy FAILED
      

      Java 19+ declares java.lang.ref.Reference sealed.

      Attachments

        Issue Links

          Activity

            People

              daniel_sun Daniel Sun
              daniel_sun Daniel Sun
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: