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
We should also check to see whether this type is passed as a generic parameter when constructing another type. I imagine that passing it as a generic to a function should also satisfy this check.
The text was updated successfully, but these errors were encountered:
This is the case exhibited in noir-bignum. The construction of a Bar doesn't imply the usage of Foo.
structFoo {}
structBar<T>{
inner: Field
}
fnmain() {
let_: Bar<Foo> = Bar { inner: 0 };
}
Something to note is that Rust disallows this case and requires the usage of the PhantomData type. We could do the same which would ensure that the type is used but would cause annoyances around abi encoding for these types.
Noticed this in
noir-bignum
but will add a smaller repro later.The
Test2048Params
struct is never constructed within the library and should not be exposed as public:https://github.com/noir-lang/noir-bignum/blob/910dcbb8c2f07efb45416d267e75fdb3361b5b01/src/bignum_test.nr#L12
However, I would consider the below line as a usage of this struct:
https://github.com/noir-lang/noir-bignum/blob/910dcbb8c2f07efb45416d267e75fdb3361b5b01/src/bignum_test.nr#L366
We should also check to see whether this type is passed as a generic parameter when constructing another type. I imagine that passing it as a generic to a function should also satisfy this check.
The text was updated successfully, but these errors were encountered: