#7601 introduces a should_pass/language/const_generics_array_in_reassignments tests with the following code snippet:
trait ConstructSelf<D> {
fn construct_self(default: D) -> Self;
}
impl<T, const N: u64> ConstructSelf<T> for [T; N]
where
T: AbiEncode + PartialEq,
{
fn construct_self(default: T) -> Self {
let mut array = [default; N];
let mut i = 0;
while i < N {
array[i] = default;
assert_eq(array[i], default);
i += 1;
}
array
}
}
type ArrayU842 = [u8;42];
When calling:
let array = ArrayU842::construct_self(42u8);
the compiler panics with:
thread 'main' (2868621) panicked at sway-core/src/ir_generation/const_eval.rs:554:13:
assertion failed: decl.value.is_some()
Related to #7616.
#7601 introduces a
should_pass/language/const_generics_array_in_reassignmentstests with the following code snippet:When calling:
the compiler panics with:
Related to #7616.