leo
leo copied to clipboard
[Bug] Unable to slice open ranges on unsized arrays
🐛 Bug Report
While working on #1528 I have discovered additional bug/behavior which should be addressed.
The code
function main() {
let x: [u8; _] = [0, 0, 0, 0];
let y = x[0..];
}
The explanation
To be able to determine the length of the array x
we'd need to resolve a reference to the array at the array range access
part of the compler. The link to the place is here: https://github.com/AleoHQ/leo/blob/staging/compiler/src/accesses/array_access.rs#L45
adding fuzzbug tag because the fuzzer can also hit this
Array slicing is currently not supported in Leo v1.6.2.