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
Attempted to compile the following program with a function that outputs a numeric generic:
// Using "[(); N]" as a parameter compiles and executes successfully//// Using "struct W<N> {}" as a parameter also panics if "foo" is called on "W {}",// but not if "foo" is called on "let w_1: W<1> = W {};"fnfoo<letN: u32>() ->u32 {
N
}
fnmain() {
foo();
}
Expected Behavior
The program to compile successfully or fail with a user error
Bug
Compiling the program panics with the following message:
The application panicked (crashed).
Message: Non-numeric type variable used in expression expecting a value
Location: compiler/noirc_frontend/src/monomorphization/mod.rs:934
To Reproduce
Workaround
Yes
Workaround Description
Use turbofish (e.g. foo::<3>()) to specify numeric generics when they can't be derived from a parameter's type
Additional Context
No response
Project Impact
None
Blocker Context
No response
Nargo Version
nargo version = 0.36.0 noirc version = 0.36.0+2f376100d3ee7ab519d6ea30153395bb3e7af7b1 (git version hash: 2f37610, is dirty: false)
NoirJS Version
No response
Proving Backend Tooling & 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:
Hmm I had thought we had a check for this case already but it looks like what was added was a slightly different check: #5840. I would've still expected main to error that the generic in the call to foo wasn't known however.
Maybe we need to edit the check_type method that is called to be more stringent.
Aim
Attempted to compile the following program with a function that outputs a numeric generic:
Expected Behavior
The program to compile successfully or fail with a user error
Bug
Compiling the program panics with the following message:
To Reproduce
Workaround
Yes
Workaround Description
Use turbofish (e.g.
foo::<3>()
) to specify numeric generics when they can't be derived from a parameter's typeAdditional Context
No response
Project Impact
None
Blocker Context
No response
Nargo Version
nargo version = 0.36.0 noirc version = 0.36.0+2f376100d3ee7ab519d6ea30153395bb3e7af7b1 (git version hash: 2f37610, is dirty: false)
NoirJS Version
No response
Proving Backend Tooling & 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: