Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.7.4, 1.8-beta-1
-
None
-
None
Description
@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()