Skip to content

Conversation

@tdelabro
Copy link
Collaborator

@tdelabro tdelabro commented Nov 5, 2025

Adding a felt! macro that allow for easy initialization of Felt from different types

..
}) => Err(Error::new_spanned(
expr,
"The `!` logical inversion operator is applicable to the `Felt` type",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the error message in this case is different than the one from line 209?
Why does this macro only accept the ! operator only with integer variables but doesn't with literals?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a bit more specific, because !42 is a valid rust expression, but is invalid in the context of Felt, and the Not operator doesn't exist in this context.
The second message is about stuff like !"abc" which are not even valid Rust expression.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to be honest !b'c' is a valid rust expression tho. COz it returns a u8.
So this one could be handled in the first one too

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

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

Successfully merging this pull request may close these issues.

4 participants