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 was actually trying to write a minimal example for a different bug, but found this on my journey:
structA<T>{b:T,}impl<T>A<T>{fnnew(b:T) -> Self{A{ b }}}structB<T>{c:T,}impl<T>B<T>{fnnew(c:T) -> Self{B{ c }}}fnmain(c:Field,d:Field) -> pub Field{letmut b = B::new(c);letmut a = A::new(b);
a.b.c *= d;
a.b.c}
error: Type B<Field> has no member named c
┌─ /mnt/user-data/mike/packages/yarn-project/noir-contracts/src/contracts/zk_nft_contract/src/main.nr:46:13
│
46 │ a.b.c *= d;
│ -
error: aborting due to 1 previous errors
Error: Failed to compile circuit
Location:
crates/nargo_cli/src/cli/mod.rs:71:5
Type B definitely has a member named c, so maybe it's confused, somehow?
Now, we can fix this by doing:
fnmain(c:Field,d:Field) -> pub Field{letmut b = B::new(c);letmut a = A::new(b);letmut ab = a.b;
ab.c *= d;
ab.c}
Which makes me think maybe nested struct access is broken?
Installation method
noirup
Nargo version
nargo 0.4.1 (git version hash: 3d2233d, is dirty: false)
@noir-lang/noir_wasm version
v0.4.1
The text was updated successfully, but these errors were encountered:
Note: #1316 was the issue I was actually aiming for, which is why there are generics in this example. You might be able to trim the generics from this issue, and still cause the bug. I haven't tried.
Aim
I was actually trying to write a minimal example for a different bug, but found this on my journey:
Type
B
definitely has a member namedc
, so maybe it's confused, somehow?Now, we can fix this by doing:
Which makes me think maybe nested struct access is broken?
Installation method
noirup
Nargo version
nargo 0.4.1 (git version hash: 3d2233d, is dirty: false)
@noir-lang/noir_wasm version
v0.4.1
The text was updated successfully, but these errors were encountered: