diff --git a/acvm-repo/blackbox_solver/src/ecdsa/secp256k1.rs b/acvm-repo/blackbox_solver/src/ecdsa/secp256k1.rs index d6f4f1c04f8..0f171b7d8ff 100644 --- a/acvm-repo/blackbox_solver/src/ecdsa/secp256k1.rs +++ b/acvm-repo/blackbox_solver/src/ecdsa/secp256k1.rs @@ -110,7 +110,7 @@ mod secp256k1_tests { } #[test] - fn rejects_signature_that_doesnt_have_the_full_y_coordinate() { + fn rejects_signature_that_does_not_have_the_full_y_coordinate() { let mut pub_key_y_bytes = [0u8; 32]; pub_key_y_bytes[31] = PUB_KEY_Y[31]; let valid = verify_signature(&HASHED_MESSAGE, &PUB_KEY_X, &pub_key_y_bytes, &SIGNATURE); diff --git a/acvm-repo/blackbox_solver/src/ecdsa/secp256r1.rs b/acvm-repo/blackbox_solver/src/ecdsa/secp256r1.rs index eda7dc385db..66005135987 100644 --- a/acvm-repo/blackbox_solver/src/ecdsa/secp256r1.rs +++ b/acvm-repo/blackbox_solver/src/ecdsa/secp256r1.rs @@ -106,7 +106,7 @@ mod secp256r1_tests { } #[test] - fn rejects_signature_that_doesnt_have_the_full_y_coordinate() { + fn rejects_signature_that_does_not_have_the_full_y_coordinate() { let mut pub_key_y_bytes = [0u8; 32]; pub_key_y_bytes[31] = PUB_KEY_Y[31]; let valid = verify_signature(&HASHED_MESSAGE, &PUB_KEY_X, &pub_key_y_bytes, &SIGNATURE); diff --git a/compiler/noirc_evaluator/src/brillig/brillig_gen/brillig_block.rs b/compiler/noirc_evaluator/src/brillig/brillig_gen/brillig_block.rs index 4c47494a430..51010f3589e 100644 --- a/compiler/noirc_evaluator/src/brillig/brillig_gen/brillig_block.rs +++ b/compiler/noirc_evaluator/src/brillig/brillig_gen/brillig_block.rs @@ -1769,7 +1769,7 @@ impl<'block, Registers: RegisterAllocator> BrilligBlock<'block, Registers> { | BinaryOp::Mul { unchecked: false } ) { - panic!("Checked signed operations should all be removed before brilliggen") + panic!("Checked signed operations should all be removed before brillig-gen") } return; } diff --git a/compiler/noirc_frontend/src/elaborator/expressions.rs b/compiler/noirc_frontend/src/elaborator/expressions.rs index f5be7c4a8d2..4bc2d404f59 100644 --- a/compiler/noirc_frontend/src/elaborator/expressions.rs +++ b/compiler/noirc_frontend/src/elaborator/expressions.rs @@ -121,7 +121,7 @@ impl Elaborator<'_> { /// Elaborate a member access expression without adding the automatic dereferencing operations /// to it, treating it as an offset instead. This also returns a boolean indicating whether the - /// result skipped any required auto-derefs (and thus needs dereferencing to be used as a value + /// result skipped any required auto-dereferences (and thus needs dereferencing to be used as a value /// instead of a reference). This flag is used when `&mut foo.bar.baz` is used to cancel out /// the `&mut`. fn elaborate_reference_expression(&mut self, expr: Expression) -> (ExprId, Type, bool) { @@ -1067,7 +1067,7 @@ impl Elaborator<'_> { location: Location, is_offset: bool, ) -> (ExprId, Type, bool) { - // We don't need the boolean 'skipped auto-derefs' from elaborate_reference_expression + // We don't need the boolean 'skipped auto-dereferences' from elaborate_reference_expression // since if we have skipped any then `lhs_type` will be a reference and we will need to // skip the deref (if is_offset is true) here anyway to extract the field out of the reference. // This is more reliable than using the boolean return value here since the return value @@ -1334,7 +1334,7 @@ impl Elaborator<'_> { self.interner.next_type_variable_with_kind(Kind::Any) } } else { - let wildcard_allowed = false; + let wildcard_allowed = true; self.resolve_type(typ, wildcard_allowed) }; diff --git a/cspell.json b/cspell.json index fa076adaf65..68954bc259c 100644 --- a/cspell.json +++ b/cspell.json @@ -276,6 +276,7 @@ "signedness", "signorecello", "signum", + "SIGPIPE", "smallvec", "smol", "splitn", diff --git a/test_programs/compile_success_empty/lambda_parameter_with_wildcard_type/Nargo.toml b/test_programs/compile_success_empty/lambda_parameter_with_wildcard_type/Nargo.toml new file mode 100644 index 00000000000..d3252c09c0b --- /dev/null +++ b/test_programs/compile_success_empty/lambda_parameter_with_wildcard_type/Nargo.toml @@ -0,0 +1,6 @@ +[package] +name = "lambda_parameter_with_wildcard_type" +type = "bin" +authors = [""] + +[dependencies] diff --git a/test_programs/compile_success_empty/lambda_parameter_with_wildcard_type/src/main.nr b/test_programs/compile_success_empty/lambda_parameter_with_wildcard_type/src/main.nr new file mode 100644 index 00000000000..78c4f005845 --- /dev/null +++ b/test_programs/compile_success_empty/lambda_parameter_with_wildcard_type/src/main.nr @@ -0,0 +1,4 @@ +fn main() { + let x = [1, 2, 3]; + let _ = x.map(|i: _| i + 1); +} diff --git a/tooling/nargo_cli/tests/snapshots/compile_success_empty/lambda_parameter_with_wildcard_type/execute__tests__expanded.snap b/tooling/nargo_cli/tests/snapshots/compile_success_empty/lambda_parameter_with_wildcard_type/execute__tests__expanded.snap new file mode 100644 index 00000000000..4ab17692694 --- /dev/null +++ b/tooling/nargo_cli/tests/snapshots/compile_success_empty/lambda_parameter_with_wildcard_type/execute__tests__expanded.snap @@ -0,0 +1,8 @@ +--- +source: tooling/nargo_cli/tests/execute.rs +expression: expanded_code +--- +fn main() { + let x: [Field; 3] = [1_Field, 2_Field, 3_Field]; + let _: [Field; 3] = x.map(|i: Field| -> Field { i + 1_Field }); +} diff --git a/tooling/nargo_cli/tests/snapshots/compile_success_empty/lambda_parameter_with_wildcard_type/execute__tests__force_brillig_false_inliner_0.snap b/tooling/nargo_cli/tests/snapshots/compile_success_empty/lambda_parameter_with_wildcard_type/execute__tests__force_brillig_false_inliner_0.snap new file mode 100644 index 00000000000..7de940827c8 --- /dev/null +++ b/tooling/nargo_cli/tests/snapshots/compile_success_empty/lambda_parameter_with_wildcard_type/execute__tests__force_brillig_false_inliner_0.snap @@ -0,0 +1,26 @@ +--- +source: tooling/nargo_cli/tests/execute.rs +expression: artifact +--- +{ + "noir_version": "[noir_version]", + "hash": "[hash]", + "abi": { + "parameters": [], + "return_type": null, + "error_types": {} + }, + "bytecode": [ + "func 0", + "current witness index : _0", + "private parameters indices : []", + "public parameters indices : []", + "return value indices : []" + ], + "debug_symbols": "XY5BCsQwCEXv4rqLWfcqw1BsaosgJtikMITefWyYQOlK/3/6tcJCc9km1jXuML4rzMYivE0SA2aO6m49B+hyykbkFty4byU00gyjFpEBDpTShvaE2mpGc/oagHTx6oErC13d+XGBge158UBjnIX+ci0abjR/Uyf942Qx0FKMrqTGPPsH", + "file_map": {}, + "names": [ + "main" + ], + "brillig_names": [] +}