-
-
Notifications
You must be signed in to change notification settings - Fork 9
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
Support traits with generic type parameters #10
Comments
This seems a fair enough request. I’d add to it My first attempt at implementing it, however, is failing due to what looks like macro hygiene, and my recollection of the workaround for that seems no longer to work. (It’s been a few years since I’ve written any bleeding-edge macros.) We could contemplate switching it to a derive attribute, which would save duplication of name and bounds and make it work, but it’s not actually deriving a trait (rather it’s adding methods to the trait object), so something like |
downcast-rs already supports generic type parameters, so you could use that for inspiration. From my own trials with macros, I'd say this is possible in most cases using declarative macros, but sometimes painful and I could never get good support for lifetimes. Procedural macros are much more capable, yet that requires another crate. BTW why are there two crates doing exactly the same thing? |
mopa predates downcast-rs by almost a year. I have never actually looked into downcast-rs, so I’m not sure what the differences may be. |
downcast-rs supports generics but not |
error: no rules expected the token
<
Is there any simple work-around?
The text was updated successfully, but these errors were encountered: