You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2016/06/01 03:44:12 UTC

[jira] [Commented] (GROOVY-7620) No error if abstract getter is not implemented but static field exists

    [ https://issues.apache.org/jira/browse/GROOVY-7620?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15309192#comment-15309192 ] 

ASF GitHub Bot commented on GROOVY-7620:
----------------------------------------

Github user asfgit closed the pull request at:

    https://github.com/apache/groovy/pull/342


> 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
>
> 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)