Details
-
Type:
Sub-task
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: 1.7.4
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
-
Number of attachments :
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