Closed waneck closed 11 years ago
[comment from ncanna...@gmail.com, published at 2013-01-07T15:19:00.000Z] The following is now forbidden since Void is a no-value while Dynamic except a value. var a:Void->Dynamic = function():Void {}
These two were not working with 2.10 I think (should be giving explicit error such as "cannot erase optional parameter") var a:Void->Void = function(a = 0):Void {} var a:Void->Void = function(?a = 0):Void {}
As for the erasure of return type, in both of these cases : var a:Void->Void = function():Dynamic return 0; var a:Void->Void = function():Int return 0;
I think they should be allowed again since it shouldn't have any bad impact to simply ignore the returned value.
[comment from Andy.onthewings, published at 2013-01-07T15:27:57.000Z] Great, thanks!
One problem, Reflect.makeVarArgs expects a Array
static function makeVarArgs<T>( f : Array<Dynamic> -> T ) : Dynamic
[comment from Andy.onthewings, published at 2013-01-07T15:30:25.000Z] Oh, maybe even better:
static function makeVarArgs<A,T>( f : Array<A> -> T ) : Dynamic
[comment from si...@haxe.org, published at 2013-01-07T15:36:49.000Z] T->S to T->Void is now allowed in r5827.
[comment from ncanna...@gmail.com, published at 2013-01-08T09:40:32.000Z] Thanks for noticing makeVarArgs bug. @Simon : maybe adding an overload here will help ?
[comment from si...@haxe.org, published at 2013-01-10T10:13:32.000Z] Maybe, but is that a solution or a workaround?
[comment from ncanna...@gmail.com, published at 2013-01-12T15:40:27.000Z] Seems like a solution to me : makeVarArgs is quite particular in the sense that the Dynamic returned value is never actually used, since it returns a new function
[comment from si...@haxe.org, published at 2013-01-13T21:06:38.000Z] I'll handle it during Reflect.hx specification then.
[comment from ncanna...@gmail.com, published at 2013-01-18T20:40:31.000Z] This issue was closed by revision r5894.
[Google Issue #1367 : http://code.google.com/haxe/issues/detail?id=1367] by Andy.onthewings, at 2013-01-07T15:11:38.000Z How Haxe is treating function types is changed since 2.10 release, and it is affecting quite a few libs I'm using (HaxePunk, hxhsl etc).
I cannot find related unit test in svn, and I guess it is good to include the following.
Compile in 2.10, but not in r5826:
Never compile, but I would like to confirm they are really disallowed (hoping not):