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
The following code should fail with a type mismatch error:
fnfoo<letN:u32>() -> u64{Nasu64}
global J:u64 = 10;fnbar<letN:u64>() -> u64{foo::<J>()}
global M:u64 = 3;fnmain(){let _ = bar::<M>();}
Expected Behavior
I expect the code above to fail that we expected a u32 for the numeric generic being passed to foo. The function foo's numeric generic N has a numeric kind with an inner type of u32. This should be type checked against the global J's type of u64 and result in an error.
Bug
The code snippet above passes without error.
To Reproduce
Run nargo compile on the snippet above
Project Impact
Nice-to-have
Impact Context
This is not a blocker for using numeric generics but developers could inadvertently use incorrect types which can lead to other bugs or confusion. We should still look to resolve this as soon as possible.
Workaround
No, aside just the developer themselves just passing the correct types.
Workaround Description
Additional Context
This may become a bit easier as part of (#5156) where we are already expecting to generalize the kind check inside of resolve_type_inner.
No response
Installation Method
None
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:
# Description
## Problem\*
- Resolves#5156
- Resolves#5447
## Summary\*
## Additional Context
## Documentation\*
Check one:
- [ ] No documentation needed.
- [x] 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.
---------
Co-authored-by: Maxim Vezenov <mvezenov@gmail.com>
Co-authored-by: jfecher <jake@aztecprotocol.com>
Co-authored-by: Tom French <15848336+TomAFrench@users.noreply.github.com>
Aim
The following code should fail with a type mismatch error:
Expected Behavior
I expect the code above to fail that we expected a
u32
for the numeric generic being passed tofoo
. The functionfoo
's numeric genericN
has a numeric kind with an inner type ofu32
. This should be type checked against the globalJ
's type ofu64
and result in an error.Bug
The code snippet above passes without error.
To Reproduce
nargo compile
on the snippet aboveProject Impact
Nice-to-have
Impact Context
This is not a blocker for using numeric generics but developers could inadvertently use incorrect types which can lead to other bugs or confusion. We should still look to resolve this as soon as possible.
Workaround
No, aside just the developer themselves just passing the correct types.
Workaround Description
Additional Context
This may become a bit easier as part of (#5156) where we are already expecting to generalize the kind check inside of
resolve_type_inner
.No response
Installation Method
None
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: