You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is because u8 is a keyword where the Foo::method syntax currently expects an identifier for Foo.
If anyone reading is encountering this issue, the workaround is to use the static trait method syntax FromField::from_field(x). If type annotations are needed, you can add a let binding:
Aim
Define a trait for all numeric types:
Expected Behavior
It should compile
Bug
Compiler errors out:
error: Unexpected u8, expected one of for, }, expression, statement
┌─ /mnt/user-data/grego/repos/noir-experiments/traits_on_u/src/main.nr:12:5
│
12 │ u8::from_field(x);
│ --
│
To Reproduce
Try to compile the provided example
Project Impact
Nice-to-have
Impact Context
No response
Workaround
None
Workaround Description
No response
Additional Context
No response
Installation Method
Binary (
noirup
default)Nargo Version
No response
NoirJS Version
No response
Would you like to submit a PR for this Issue?
None
Support Needs
No response
The text was updated successfully, but these errors were encountered: