-
-
Notifications
You must be signed in to change notification settings - Fork 670
Add unused type parameter to retain and release to prepare for closures #1287
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 unused type parameter to retain and release to prepare for closures #1287
Conversation
This comment has been minimized.
This comment has been minimized.
@dcodeIO thoughts on this? If this is okay to go in then it'd be great to have it in sooner rather than later since it'll help people review the closures PR |
Yes, this change looks good, going to take a look at the PR now. |
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.
Generally looks good to make this change, just a few comments. Not all of the comments are strictly related to your change, but some also propose to establish a proper convention for the helpers, in that whenever a raw expression without a type is taken, the corresponding type must be provided as well. Does that sound good to you?
Makes sense to me. If it's a more general thing though let's put it into a separate issue. |
I likely haven't added the type everywhere, but everywhere which calls retain/release which feels appropriate for this PR, and then maybe spin out an issue if we feel like we need the rest? |
Looks like I'm failing the new lint now? |
No, it's still old tslint currently. Just replace top-level function |
Co-authored-by: Daniel Wirtz <dcode@dcode.io>
Co-authored-by: Daniel Wirtz <dcode@dcode.io>
52ed016
to
d61b7ea
Compare
Should be good to go now |
@dcodeIO could you look? |
Thanks, rechecked and looks good! |
Extracting some no-op changes from my Closures PR to make it easier to parse.
What's been extracted is just the change to have type information passed into retain/release in any scenario where the expression could refer to a function pointer.
Context behind this change:
While none of the below is actually present in this change, which does nothing, it explains what this change will be used for in the closures implementation.
With our current scheme of altering function references so that they can hold closures or normal function references, we need to know the type of a block in order to know how to retain or release it.