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

Sub class can't override final static property

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.4.7
    • 2.4.8
    • class generator
    • None

    Description

      Running the code below, "Derived Class" is expected to be printed out, but instead "Base Class" is printed.

      class Base {
          static final String CONST = "Base Class"
      }
      
      class Derived extends Base {
          static final String CONST = "Derived Class"
      }
      
      println Derived.CONST
      

      When writing this same code in Java, "Derived Class" is properly printed out.

      Attachments

        Issue Links

          Activity

            People

              paulk Paul King
              cott@redstonecontentsolutions.com Caleb Ott
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: