groovy-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul King (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (GROOVY-7620) No error if abstract getter is not implemented but static field exists
Date Wed, 01 Jun 2016 05:01:12 GMT

     [ https://issues.apache.org/jira/browse/GROOVY-7620?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Paul King resolved GROOVY-7620.
-------------------------------
       Resolution: Fixed
         Assignee: Paul King
    Fix Version/s: 2.4.7

Proposed PR applied

> No error if abstract getter is not implemented but static field exists
> ----------------------------------------------------------------------
>
>                 Key: GROOVY-7620
>                 URL: https://issues.apache.org/jira/browse/GROOVY-7620
>             Project: Groovy
>          Issue Type: Bug
>          Components: Compiler
>    Affects Versions: 2.4.5
>            Reporter: Sergei Egorov
>            Assignee: Paul King
>             Fix For: 2.4.7
>
>
> Code example:
> {code:java}
> ​abstract class A {
>    abstract Object getFoo();
>    void test() {
>        println getFoo();
>    }
> }
> class B extends A {
>    static Object foo;
> }
> new B().test()
> /*
> java.lang.AbstractMethodError: A.getFoo()Ljava/lang/Object;
> at A.test(Script1.groovy:5)
> at A$test.call(Unknown Source)
> at Script1.run(Script1.groovy:14)
> */
> {code}
> CompileStatic will not report an error as well.



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

Mime
View raw message