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

Can't use build as an argument name in Props nor component(inline_props) #576

Open
Dav1dde opened this issue Feb 12, 2023 · 0 comments
Open
Labels
A-macro Area: macros C-bug Category: bug, something isn't working

Comments

@Dav1dde
Copy link
Contributor

Dav1dde commented Feb 12, 2023

Describe the bug

This does not compile:

struct Build;

#[component(inline_props)]
pub fn PobItemSet<'a, G: Html>(
    cx: Scope<'a>,
    build: &'a Build,
) -> View<G> {
    todo!()
}

Because build clashes with code generated by the macro. The same happens with non-inline props and a field named build.

Expected behavior

The macro generates boilerplate which does not collide with regular names, either buy using a trait (PropTrait::build) or by generating names that have a very slim/no chance of colliding with user code.

Environment

  • Sycamore: 0.8.2
@lukechu10 lukechu10 added C-bug Category: bug, something isn't working A-macro Area: macros labels Feb 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-macro Area: macros C-bug Category: bug, something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants