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

cloned! macro doesn't use absolute paths #339

Closed
arctic-hen7 opened this issue Jan 29, 2022 · 2 comments
Closed

cloned! macro doesn't use absolute paths #339

arctic-hen7 opened this issue Jan 29, 2022 · 2 comments
Labels
C-bug Category: bug, something isn't working

Comments

@arctic-hen7
Copy link
Contributor

It seems that the cloned! macro doesn't use the absolute path to itself, meaning that it can't be used in another macro as ::sycamore::prelude::cloned!.

macro_rules! cloned {
(($($arg:ident),*) => $e:expr) => {{
// clone all the args
$( let $arg = ::std::clone::Clone::clone(&$arg); )*
$e
}};
($($arg:ident),* => $e:expr) => {
cloned!(($($arg),*) => $e)
};
}

I'm happy to try a fix for this, but I'm not sure if you'd want to use an absolute path that goes through sycamore_reactive or sycamore::prelude... (Perhaps cloned! should be redeclared in the Sycamore package?)

@lukechu10 lukechu10 added the C-bug Category: bug, something isn't working label Jan 29, 2022
@lukechu10
Copy link
Member

I'm pretty sure we can use $crate here since it's a MBE. You're welcome to send a PR if you want and I can cut a new minor release for 0.7 merged. Do note that I'm on the verge of merging #337 which will remove any use for this macro.

@arctic-hen7
Copy link
Contributor Author

I don't need this urgently, I've just worked around by useing it in a new block, and if #337 will make this entirely obsolete (hooray!) then this is fine to be closed I think!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug, something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants