Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
2.1.0
-
None
-
groovy-2.1.0 on Windows using IDEA IC123.139
Description
I have 3 delegate clases:
class CommonDelegate { def String value = "CommonDelegate" }
class CommonDelegate2 { def String value = "CommonDelegate2" }
class CommonDelegate3 { def String value = "CommonDelegate3" }
and a class Foo:
class Foo extends CommonDelegate { @Delegate def CommonDelegate2 commonDelegate2 = new CommonDelegate2() @Delegate def CommonDelegate3 commonDelegate3 = new CommonDelegate3() }
Now, I run this code:
def Foo foo = new Foo()
println(foo.getValue())
And this prints "CommonDelegate2"
Question is now whether @Delegate should complain about the ambiguous call to getValue() in foo.getValue() as people expect @Delegate to be type-safe