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

Sub class can't override final static property

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.4.7
    • Fix Version/s: 2.4.8
    • Component/s: class generator
    • Labels:
      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

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

                Dates

                • Created:
                  Updated:
                  Resolved: