leo icon indicating copy to clipboard operation
leo copied to clipboard

[Bug] Unable to slice open ranges on unsized arrays

Open damirka opened this issue 3 years ago • 1 comments

🐛 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

damirka avatar Jan 24 '22 14:01 damirka

adding fuzzbug tag because the fuzzer can also hit this

0rphon avatar Jan 24 '22 18:01 0rphon

Array slicing is currently not supported in Leo v1.6.2.

collinc97 avatar Jan 05 '23 19:01 collinc97