-
-
Notifications
You must be signed in to change notification settings - Fork 632
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
Rewrite inline generic bounds #949
Comments
In my opinion, the easiest way to implement this, is to use recursive #[component]
fn Comp(cx: Scop, prop impl Fn()) -> impl IntoView {} should expand to exactly #[component]
fn Comp<__0>(cx: Scope, prop: __0) -> impl IntoView
where
__0: Fn()
{} This way, the compiler will invoke the macro again and continue as normal. Of course, in any recursion problem, we need a base case to stop recursion. In this case, we'd just check to see if there are any generics of the previous form we'd need to transform. If there are non, then we continue as normal. |
Oh I would genuinely love to have both these generic patterns available: I think Do you want to take a try at this? |
Currently, the following doesn't compile, but perhaps should:
The above does not work because the generics need to be rewritten to be:
Likewise, this doesn't compile either:
In this case, for each
impl
inline trait, we'd need to rewrite it with some anonymous type name:The text was updated successfully, but these errors were encountered: