Details

    • Type: Sub-task Sub-task
    • Status: Open Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 1.7.4
    • Fix Version/s: None
    • Component/s: groovy-runtime
    • Labels:
      None
    • Number of attachments :
      0

      Description

      If a class with static methods is mixed in another class, the static methods are not available as static methods.
      Furthermore a strange behaviour occurs - they are available as instance methods and when once called as instance methods they also get available as static methods - see the code below.

      class Base {
          def instanceMethod() { println 'instance method' }
          static staticMethod() { println 'static method' }
      }
      
      class T1 {}
      class T2 {}
      
      T1.mixin Base
      T2.mixin Base
      
      t1 = new T1()
      t1.instanceMethod()
      t1.staticMethod()
      T1.staticMethod()   // somehow working, after callling it as an instance method before - thats' strange!!!
      
      t2 = new T2()
      t2.instanceMethod()
      T2.staticMethod()   // not working: Caught: groovy.lang.MissingMethodException: No signature of method: static T2.staticMethod() is applicable for argument types: () values
      

        Activity

        No work has yet been logged on this issue.

          People

          • Assignee:
            Unassigned
            Reporter:
            Rene Scheibe
          • Votes:
            9 Vote for this issue
            Watchers:
            9 Start watching this issue

            Dates

            • Created:
              Updated: