diff --git a/compiler/noirc_evaluator/src/acir/mod.rs b/compiler/noirc_evaluator/src/acir/mod.rs index a3c44e055b..6789cbafb7 100644 --- a/compiler/noirc_evaluator/src/acir/mod.rs +++ b/compiler/noirc_evaluator/src/acir/mod.rs @@ -1334,7 +1334,7 @@ impl<'a> Context<'a> { typ: &Type, ) -> Result { match typ { - Type::Numeric(_) => self.array_get_value(&Type::field(), call_data_block, offset), + Type::Numeric(_) => self.array_get_value(typ, call_data_block, offset), Type::Array(arc, len) => { let mut result = im::Vector::new(); for _i in 0..*len { diff --git a/test_programs/execution_success/regression_7143/Nargo.toml b/test_programs/execution_success/regression_7143/Nargo.toml new file mode 100644 index 0000000000..1f581c8b24 --- /dev/null +++ b/test_programs/execution_success/regression_7143/Nargo.toml @@ -0,0 +1,6 @@ +[package] +name = "regression_7143" +type = "bin" +authors = [""] + +[dependencies] diff --git a/test_programs/execution_success/regression_7143/Prover.toml b/test_programs/execution_success/regression_7143/Prover.toml new file mode 100644 index 0000000000..f2f801df88 --- /dev/null +++ b/test_programs/execution_success/regression_7143/Prover.toml @@ -0,0 +1,3 @@ +array = [0] +x = 0 +return = 1 diff --git a/test_programs/execution_success/regression_7143/src/main.nr b/test_programs/execution_success/regression_7143/src/main.nr new file mode 100644 index 0000000000..396ddf1a63 --- /dev/null +++ b/test_programs/execution_success/regression_7143/src/main.nr @@ -0,0 +1,3 @@ +fn main(x: u32, array: call_data(0) [bool; 1]) -> pub bool { + !array[x] +}