Fix generic props structs#2746
Conversation
|
Visit the preview URL for this PR (updated for commit b83695f): https://yew-rs-api--pr2746-prop-inheritance-zq5xlke7.web.app (expires Wed, 29 Jun 2022 20:30:53 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 |
|
@maurerdietmar if you have time to check, I think this fixes your issue. @hamza1311 aha! the issue with |
Size ComparisonDetails
✅ None of the examples has changed their size significantly. |
ranile
left a comment
There was a problem hiding this comment.
Looks good
The comments are unrelated to this PR but should be resolved (in a future PR). I must've missed the output spans while reviewing the previous one
| --> tests/html_macro/component-fail.rs:94:10 | ||
| | | ||
| 94 | <Child ..ChildProperties { string: "hello".to_owned(), int: 5 }> | ||
| | ^^^^^ unknown field |
There was a problem hiding this comment.
This is a bad span. Can we do better?
There was a problem hiding this comment.
I agree in principle, but don't want to block this PR with this. The errors were like this before, even before #2729 . This PR only affects the order in which errors are reported, since they emit from a non-const context again. Don't ask me why that changes the order of error reporting though, idk :)
Note that this bad span is only for field children. Not sure what's a better span here.
| 27 | html! { <Comp<MissingTypeBounds> /> }; | ||
| | ^^^^ the trait `yew::BaseComponent` is not implemented for `Comp<MissingTypeBounds>` |
There was a problem hiding this comment.
Span should reference MissingTypeBounds here
Yes, this fixes my issue. |
Description
Fixup of #2729 for generic property structs. I mistakenly converted the checks guarded by
if falseto aconst _: ()check, which makes generic arguments from the context invisible, leading to the problemThis also for some reason changes the order in which errors are reported with trybuild.
Checklist