-
-
Notifications
You must be signed in to change notification settings - Fork 653
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add haxe.EitherType (see HaxeFoundation/hxnodejs#15) #3465
Conversation
@waneck proposes adding |
Wouldn't |
About var value = someFunction().left; //what is the type of value?
var value:Int = someFunction(); //ok, it is an Int
//nested EitherType
var value = someFunction2().left.left.right; //what? Also since this is mainly used for extern, and nowadays we used to generate them from doc. It is possible the order of @:overload(function(v:Int):EitherType<Int, String>{})
public function fun():EitherType<String, Int>;
/* ... */
$type(fun().left) //String
$type(fun(123).left) //Int |
Hmm, that's a valid argument, @andyli. I thought simply using |
add haxe.EitherType (see HaxeFoundation/hxnodejs#15)
Merging it as is. |
Could we shorten it to |
Couldn't we move it in a subpackage like 'haxe.externs' to make clear that its a helper class for externs? Btw. I like the name Choice for it. |
That's an interesting idea, it could live next to haxe.Rest and perhaps even ArrayAccess. |
No description provided.