-
-
Notifications
You must be signed in to change notification settings - Fork 407
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
Allow moving NativeObject
variables into closures as external captures
#1523
Conversation
69b9b0a
to
51b3f01
Compare
NativeObject
variables in closuresNativeObject
variables in closures as external captures
NativeObject
variables in closures as external capturesNativeObject
variables into closures as external captures
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
Maybe you could add the test (or something similar) to the examples? NativeObject
is pretty abstract and it may not be clear what you can do with closure_with_captures
without an example.
Okay, let me add an example |
1c364fb
to
4105db6
Compare
Added an example inside |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow, the automatic downcast looks really nice from an API consumer perspective. We only have to make sure that the downcast never fails, otherwise the error is really confusing.
The example looks great!
I just noticed that there are some lints in this latest version. You may want to fix those. |
4105db6
to
f6bd483
Compare
f6bd483
to
4a0d011
Compare
Rebased |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me! :)
This Pull Request follows from #1518.
It changes the following:
NativeObject + Clone
type as a parameter into any closureThis unblocks the implementation of arguments exotic objects.
The new test is a good example of how this new feature works: