-
Notifications
You must be signed in to change notification settings - Fork 236
Fix TCFType macros for generic types #652
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
Conversation
This is needed to create a type-safe generic abstraction over |
Friendly ping @jdm, would you or another maintainer be willing to take a look at this? |
@tmandry I'd like to get this unblocked for you. Could you rebase to current |
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.
Would it be possible to add a test so that it at least remains in a compiling state?
This adds the following new features: * `declare_TCFType!`: Generics are accepted. * `impl_TCFType!`: Non-defaulted generics are accepted, and impls are fixed to be for all generics. In addition, some warnings are silenced and the macros no longer depend on any traits being in scope in the caller.
Thanks for taking a look @waywardmonkeys. Should be ready 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.
Thanks! I think this looks great! Will leave open for a day or so in case others want to review.
impl_TCFType!
accepts generic types but some of its impls are missing the generics. They work on types with defaulted generics, but only in the default case. This PR fixes that.It also updates
declare_TCFType!
to accept generics as a convenience. We use one PhantomData per parameter, as is already done inimpl_TCFType!
.In addition, some warnings are silenced, and the macros no longer depend on any traits being in scope in the caller.