I have a method in a parent class that I need to override in
a child, but the parent's version of the method uses a rest (...)
parameter as its only argument.
Since the argument arrives in the overridden class as an
array, how do I then pass that data on to the original method (i.e.
super.function())? Is there any way to indicate that an array
should be treated like a rest parameter?
I've since solved my application specific issue using a
different approach, but I wasn't able to find anything that
addressed the problem above in the Docs.
Alex Harui over on FlexCoders graciously answered this one
for me, so I'll post the answer here in case anyone else ever needs
To pass a rest parameter, do the following:
override public function foo(... rest):void
The apply() method is a member of the Function class, and is
an alternate means of calling a method. The first parameter is a
reference to your object, and the second is an array containing an
arbitrary number of arguments.