You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Sergei Egorov (JIRA)" <ji...@apache.org> on 2015/10/07 18:37:27 UTC

[jira] [Updated] (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:all-tabpanel ]

Sergei Egorov updated GROOVY-7620:
----------------------------------
    Description: 
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.

  was:
Code example:
{code:java}
​abstract class A {
   abstract Object getFoo();

   void test() {
       println getFoo();
   }
}

class B extends A {
   static Object foo;
}

new B().test()
{code}

CompileStatic will not report an error as well.


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