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

Impossible to instantiate ybc::Input as type is a prohibited identifier #19

Closed
Moxinilian opened this issue Apr 11, 2021 · 2 comments
Closed

Comments

@Moxinilian
Copy link

Moxinilian commented Apr 11, 2021

While trying to instantiate an Input component with a custom type, as the struct uses a field name type that conflicts with the Rust reserved type keyword, the macro gets confused and refuses to build. I might be misusing it here, but I can't find a way around it beyond renaming it in the props struct.

@Moxinilian Moxinilian changed the title Impossible to instanciate ybc::Input as type is a prohibited identifier Impossible to instantiate ybc::Input as type is a prohibited identifier Apr 12, 2021
@thedodd
Copy link
Owner

thedodd commented Jul 26, 2021

Hello there. In Rust, the way you deal with that is as follows: r#type. This allows you to use any identifier, even those reserved for language purposes.

@thedodd thedodd closed this as completed Jul 26, 2021
@Moxinilian
Copy link
Author

I recall trying this but it still not building on latest Rust at the time. Unfortunately I don't have this project anymore to check this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants