groovy-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Caleb Ott (JIRA)" <j...@apache.org>
Subject [jira] [Created] (GROOVY-7917) Sub class can't override final static member
Date Wed, 24 Aug 2016 20:36:20 GMT
Caleb Ott created GROOVY-7917:
---------------------------------

             Summary: Sub class can't override final static member
                 Key: GROOVY-7917
                 URL: https://issues.apache.org/jira/browse/GROOVY-7917
             Project: Groovy
          Issue Type: Bug
          Components: class generator
            Reporter: Caleb Ott


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

{code:java}
class Base {
    static final String CONST = "Base Class"
}

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

println Derived.CONST
{code}

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



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message