-
-
Notifications
You must be signed in to change notification settings - Fork 646
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
.bind() ignores optional arguments when returns new binded function #3082
Comments
that's how bind works. If you don't want to bind optional arguments you have to do it explicit like: |
wooooow.... thank you! it would be very useful to say that in official docs :D |
that's why i created an issue for this ;) |
thank you very much |
I wonder why we designed it like that... |
I don't know, do you think it would be better to not bind optional arguments by default? I guess that's a matter of taste. |
Both are arbitrary choice, but I found by experience that in general you want to have the optional arguments ignored, hence the design |
But you could still ignore them when calling the resulting function, which is why it seems to be more flexible that way. |
The problem is that you cannot erase optional arguments when unifying functions. |
Haxe 3.1.3.
Piece of code says it's better than a thousand words:
$type(foo2.bind(5));
should be ?String -> Void instead.The text was updated successfully, but these errors were encountered: