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
I tried to compile types with parentheses in two locations:
str<(Foo)> - string type with a parethesized argument
[Foo; (Bar)] - array type with a parenthesized length
Expected Behavior
Expected the types to compile with at most a warning.
Bug
This is inconsistent with other type expressions in Noir, and with the Rust parser which gives a warning (I know we differ from Rust grammar, but still).
To Reproduce
Compile:
fnfoo<Bar>(bar:[Bar;(123)]){}
-> Error: Expression is invalid in an array-length type: 'Error'. Only unsigned integer constants, globals, generics, +, -, *, /, and % may be used in this context.
fnfoo<Foo>(bar:str<(Foo)>){}
-> ???
Installation Method
Compiled from source
Nargo Version
No response
Additional Context
Bug found with the parser-fuzzer tool.
Would you like to submit a PR for this Issue?
No
Support Needs
No response
The text was updated successfully, but these errors were encountered:
kevaundray
changed the title
(nitpick) The parser does not allow parenthesizing in two type locations
(fuzzer) The parser does not allow parenthesizing in two type locations
Aug 21, 2023
kevaundray
changed the title
(fuzzer) The parser does not allow parenthesizing in two type locations
(fuzzer) - The parser does not allow parenthesizing in two type locations
Aug 21, 2023
Aim
I tried to compile types with parentheses in two locations:
str<(Foo)>
- string type with a parethesized argument[Foo; (Bar)]
- array type with a parenthesized lengthExpected Behavior
Expected the types to compile with at most a warning.
Bug
This is inconsistent with other type expressions in Noir, and with the Rust parser which gives a warning (I know we differ from Rust grammar, but still).
To Reproduce
Compile:
-> Error:
Expression is invalid in an array-length type: 'Error'. Only unsigned integer constants, globals, generics, +, -, *, /, and % may be used in this context.
-> ???
Installation Method
Compiled from source
Nargo Version
No response
Additional Context
Bug found with the parser-fuzzer tool.
Would you like to submit a PR for this Issue?
No
Support Needs
No response
The text was updated successfully, but these errors were encountered: