[haXe] minor issues with -as3
Nicolas Cannasse
ncannasse at motion-twin.com
Wed Apr 11 10:07:38 CEST 2007
> The 1st issue is that "override" is not being copied/transferred to the
> .as file.
> The following program compiles correctly with the settings:
This have been patched on haXe CVS.
> The 2nd issue can be seen in this error message which was generated by
> Flex:
>
> C:\Program Files\Adobe\Flex Builder 2\Flex SDK 2\bin>mxmlc
> C:\haxe\test\__main__.as
> Loading configuration file C:\Program Files\Adobe\Flex Builder 2\Flex
> SDK 2\frameworks\flex-config.xml
> C:\haxe\test\Test4.as(19): col: 51 Error: Incompatible default value of
> type Null where Boolean is expected.
>
> static public function myFunct2(yyy : Boolean = null) :
> String {
> ^
>
> -------------- original file: Test4.hx --------------
>
> class Test4 {
>
> static function main() {
> new Test4 ();
> trace("** " + myFunct1(true));
> trace("** " + myFunct2());
> }
>
> public function new() {
> }
>
> public static function myFunct1 (xxx:Bool) : String {
> return "myFunct1";
> }
>
> public static function myFunct2 (?yyy:Bool) : String {
> return "myFunct2";
> }
> }
Yes, as explained here : http://haxe.org/tutos/as3_gen , you need to use
Null<Bool> (or Null<Int> and Null<Float>) for optional arguments.
Nicolas
More information about the Haxe
mailing list