Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.8.8
-
None
Description
If I do something like this...
String.metaClass.doSomething = { Object[] args -> println args.length } 'Scott Gorham'.doSomething(1, 2, 3)
args.length is 3, which is what I would expect.
If I do something like this...
String.metaClass.static.doSomething = { Object[] args -> println args.length println args[0].length } String.doSomething(1, 2, 3)
Then args.length is 1 and args[0].length is 3. The array that contains the actual arguments (1, 2, 3) is being wrapped inside of another array.
The instance method is behaving the way I would expect. The static method is not. It seems like these should behave the same with respect to this.