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

No error if abstract getter is not implemented but static field exists

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.4.5
    • Fix Version/s: 2.4.7
    • Component/s: Compiler
    • Labels:
      None

      Description

      Code example:

      ‚Äč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)
      */
      

      CompileStatic will not report an error as well.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                paulk Paul King
                Reporter:
                bsideup Sergei Egorov
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: