Closed Type1J closed 9 years ago
Although it's not type safe, there's another version of this code that's used for Flash, However, because the abstract type is still compiled for Flash the Flash builds will not compile.
If I comment out the abstract type used to take either Array or haxe.ds.Vector, and I used the #if flash version of the code that used Dynamic for both Flash and other platforms, then everything works correctly. Again, this version is less type safe.
This should work if you declare the cast functions like so:
@:from static function fromA<A,B>( v:A ):AcceptEither<A,B> return new AcceptEither( Left(v) );
@:from static function fromB<A,B>( v:B ):AcceptEither<A,B> return new AcceptEither( Right(v) );
@Simn: Thanks, for the second time today! @Greg209: I've tested the change that @Simn suggested, and it's working great. Please add "<A,B>" between the function names and the argument list for these 2 functions.
@Simn & @Type1J Thanks to looking into this and getting the solution together. Your help is much appreciated :)
You're welcome! I would appreciate if you could make sure that all your tests/examples are working properly with Haxe 3.2.0-RC2.
Will do. Just not had chance to update to 3.2 yet but I do consider it a priority.
When compiling just about anything that uses Away3D with Haxe 3.2, I get: away3d/utils/ArrayUtils.hx:76: characters 15-89 : Class not found : A
I think it's related to the breaking change:
(See https://github.com/HaxeFoundation/haxe/wiki/Breaking-changes-in-Haxe-3.2.0)