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
/// A trait for types that can be decoded from a calldata field arraytraitFromCallData<letN:u32,letM:u32>{/// Decodes Self by consuming it from the head of calldata, returning the remaining calldatafnfrom_calldata(calldata:[Field;N]) -> (Self,[Field;M]);}structPoint{x:Field,y:Field}impl<letN:u32>FromCallData<N,N - 1>forField{fnfrom_calldata(calldata:[Field;N]) -> (Self,[Field;(N - 1)]){let slice = calldata.as_slice();let(value, slice) = slice.pop_front();(value, slice.as_array())}}impl<letN:u32>FromCallData<N,N - 2>forPoint{fnfrom_calldata(calldata:[Field;N]) -> (Self,[Field;(N - 2)]){let(x, calldata) = FromCallData::from_calldata(calldata);let(y, calldata) = (1,foo(calldata));//FromCallData::from_calldata(calldata);(Self{ x, y }, calldata)}}fnfoo<letN:u32>(_a:[Field;N]) -> [Field;N - 1]{
std::mem::zeroed()}fnmain(){let calldata = [1,2];let _:(Point,_) = FromCallData::from_calldata(calldata);}
Expected Behavior
The program to type check correctly
Bug
error: expected type (Point, [Field; (N - 2)]), found type (Point, [Field; (N - 2)])
┌─ src/main.nr:18:47
│
18 │ fn from_calldata(calldata: [Field; N]) -> (Self, [Field; (N - 2)]) {
│ ------------------------ expected (Point, [Field; (N - 2)]) because of return type
·
21 │ (Self { x, y }, calldata)
│ ------------------------- (Point, [Field; (N - 2)]) returned here
│
(The error changes if the foo call is replaced with another from_call_data call)
To Reproduce
Workaround
None
Workaround Description
No response
Additional Context
No response
Project Impact
None
Blocker Context
No response
Nargo Version
No response
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:
…6008)
# Description
## Problem\*
Resolves#6006
## Summary\*
Previously we were failing for constraints like `a + 3 = b + 1` when we
could instead move the constant terms to one side: `a + 2 = b` then
solve with `b := a + 2`.
## Additional Context
## Documentation\*
Check one:
- [x] No documentation needed.
- [ ] Documentation included in this PR.
- [ ] **[For Experimental Features]** Documentation to be submitted in a
separate PR.
# PR Checklist\*
- [x] I have tested the changes locally.
- [x] I have formatted the changes with [Prettier](https://prettier.io/)
and/or `cargo fmt` on default settings.
Aim
Expected Behavior
The program to type check correctly
Bug
(The error changes if the
foo
call is replaced with anotherfrom_call_data
call)To Reproduce
Workaround
None
Workaround Description
No response
Additional Context
No response
Project Impact
None
Blocker Context
No response
Nargo Version
No response
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: