[osflash] mtasc, strict, strictly typed arrays
Darren Cook
darren at dcook.org
Wed Feb 22 20:37:31 EST 2006
I have the below function. When I use "return [v,ix];" then "mtasc
-strict" complains with:
type error Array should be #Number.Array
When I change to define a return variable it is happy.
Q1: Is there a way to avoid having to define a return variable?
Q2: If not, does defining a return variable have any effect on the size
of the generated code, or does it get optimized away by the compiler?
Q3: Would Hamtasc behave any differently?
Thanks,
Darren
---------------------------------------------------
public static function foo(...): /*Number*/Array {
var v:Number=Number.MAX_VALUE;
var ix:Number;
...
//return [v,ix];
var r:/*Number*/Array=[v,ix];
return r;
}
More information about the osflash
mailing list