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

Category methods are not inherited

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.6-rc-2, 1.6-rc-3
    • Fix Version/s: 1.6.1, 1.7-beta-1
    • Component/s: None
    • Labels:
      None
    • Environment:
      JDK 1.6, Windows

      Description

      see the example:

      public class Foo {
        static Object foo(Object obj) {
          println "Foo.foo()"
          return obj;
        }
      }
      
      public class Bar extends Foo{
        static Object bar(Object obj) {
          println "Bar.bar()"
          return obj;
        }
      }
      
      def obj = new Object()
      
      use(Foo){
        obj.foo()
      }
      
      use(Bar){
        obj.bar()
        obj.foo() // Caught: groovy.lang.MissingMethodException: 
      }
      

      Exception

      Caught: groovy.lang.MissingMethodException: No signature of method: java.lang.Object.foo() is applicable for argument types: () values: []
      	at test$_run_closure2.doCall(test.groovy:10)
      	at test$_run_closure2.doCall(test.groovy)
      	at test.run(test.groovy:8)
      

        Attachments

          Activity

            People

            • Assignee:
              blackdrag Jochen Theodorou
              Reporter:
              mingfai Mingfai Ma
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: