Skip to content

Commit

Permalink
Add error
Browse files Browse the repository at this point in the history
  • Loading branch information
d0cd committed Apr 19, 2024
1 parent 95ee4a4 commit 19a3620
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions errors/src/errors/type_checker/type_checker_error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -775,4 +775,11 @@ create_messages!(
msg: format!("Cannot use operation `{operation}` on external mapping."),
help: Some("The only valid operations on external mappings are get, and get_or_use.".to_string()),
}

@formatted
finalize_cannot_assign_to_outer_scope {
args: (variable: impl Display),
msg: format!("Cannot re-assign to `{variable}` in an outer scope in a finalize block."),
help: Some("This is a fundamental restriction that can often be avoided by using a ternary operator `?` or re-declaring the variable in the current scope. In the future, ARC XXXX (https://github.com/AleoHQ/ARCs) will support more complex assignments in finalize blocks.".to_string()),
}
);

0 comments on commit 19a3620

Please sign in to comment.