-
Type:
Bug
-
Status: Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.7.4, 1.8-beta-1
-
Fix Version/s: 1.7.4, 1.8-beta-1
-
Component/s: None
-
Labels:None
@Delegate's dealing with static methods seems incorrect
In the code below, shouldn't the call from B#main() go to C#foo()?
If for a delegate method (which can only be an instance method), if the owner class has a static method, the delegate method should be the one used.
A.groovy
class A { static foo(){println "A->foo()"} }
B.groovy
class B extends A { @Delegate C c = new C() static main(args){ new B().foo() } }
C.groovy
class C { def foo(){println "C->foo()"} }
The above code outputs
A->foo()
but it should output
C->foo()