-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Remove Component validation in html! to allow for generic components #1065
Conversation
Take a look at the tests that we run in CI.. The macro test is going to fail because the compiler error message will be different |
Oops, macro tests were not running. Could you please rebase off last master and fix the tests? |
Because this validation check tries to impl Component for the component type, generic components could not have been used.
There is a broken link in the guide for the
I get
Running the tests with
yields
Not sure where this is coming from. Do you have any problems running the tests on the current master? |
@mankinskin you'll have to run that command from |
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! Now you can see why I added that validation check 😉
Yes indeed, it might be confusing at first, but at least it contains the helpful error at the end :) But it would still be interesting to know how to get the trait bounds of a generic type argument from a proc macro .. |
Haha yes very true!
Yeah, I think it's possible. We can inspect and validate the generics from the component type if present. Just don't have time to do so now :) |
🎉 released in v0.14.3 |
Because this validation check tries to
impl Component
for the componenttype, generic components could not have been used, because the
impl
has to define the generic type parameter itself, but it can only see the<C>
part directly, and thus can not define the type parameters trait bounds properly.With this change, it is possible to write a component like this, with a generic type parameter with trait bounds.
See more details in this issue: #1064