Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.1-rc-1, 1.1-rc-2
-
None
-
None
Description
simple example:
def closure = {x -> x} def foo = closure.call([1] as Object[]) assert foo == 1
while closure has one doCall method, that accepts only one argument, it has two call methods, one of them accepts an array and should be selected here. This method then calls doCall with "this.doCall(*args)" which means the doCall method taking one argument should be choosen and the argument to that method is the conten of the array, the value 1. In stead of this ClosureMetaClass has a bug, which let's it call doCall with the array, which means the call is "this.doCall(args)" instead of "this.doCall(*args)". Which is wrong, foo will have the value [1] instead of 1