Skip to content
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

Fix TCFType macros for generic types #652

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

tmandry
Copy link

@tmandry tmandry commented Jan 2, 2024

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 in impl_TCFType!.

In addition, some warnings are silenced, and the macros no longer depend on any traits being in scope in the caller.

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.
@tmandry tmandry changed the title Improve TCFType macros Fix TCFType macros for generic types Jan 29, 2024
@tmandry
Copy link
Author

tmandry commented Jan 29, 2024

This is needed to create a type-safe generic abstraction over AXValue; see value.rs in eiz/accessibility#5.

@tmandry
Copy link
Author

tmandry commented Jan 29, 2024

Friendly ping @jdm, would you or another maintainer be willing to take a look at this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant