diff --git a/compiler/tests/circuits/const_self_variable_fail.leo b/compiler/tests/circuits/const_self_variable_fail.leo new file mode 100644 index 0000000000..fca9620946 --- /dev/null +++ b/compiler/tests/circuits/const_self_variable_fail.leo @@ -0,0 +1,13 @@ +circuit Foo { + a: u8, + + function set_a(const self, new: u8) { + self.a = new; + } +} + +function main() { + let f = Foo { a: 0u8 }; + + f.set_a(1u8); +} \ No newline at end of file diff --git a/compiler/tests/circuits/mod.rs b/compiler/tests/circuits/mod.rs index 3fe4b54955..77d8801e4b 100644 --- a/compiler/tests/circuits/mod.rs +++ b/compiler/tests/circuits/mod.rs @@ -132,6 +132,15 @@ fn test_member_static_function_undefined() { expect_asg_error(error) } +// Constant +#[test] +fn test_const_self_variable_fail() { + let program_string = include_str!("const_self_variable_fail.leo"); + let error = parse_program(program_string).err().unwrap(); + + expect_asg_error(error); +} + // Mutability #[test] diff --git a/examples/pedersen-hash/src/main.leo b/examples/pedersen-hash/src/main.leo index 5f5a650006..84670cd6c2 100644 --- a/examples/pedersen-hash/src/main.leo +++ b/examples/pedersen-hash/src/main.leo @@ -19,11 +19,7 @@ circuit PedersenHash { // The 'pedersen-hash' main function. function main(hash_input: [bool; 256], const parameters: [group; 256]) -> group { -<<<<<<< HEAD const pedersen = PedersenHash::new(parameters); -======= - let pedersen = PedersenHash::new(parameters); ->>>>>>> 9b61d0fa152f435e3e165090455c85eedeb9b770 return pedersen.hash(hash_input) }