use std::fmt::Display;
create_messages!(
#[derive(Hash, Eq, PartialEq)]
StaticAnalyzerWarning,
code_mask: 4000i32,
code_prefix: "SAZ",
@formatted
some_paths_do_not_run_all_finals {
args: (num_total_paths: impl Display, num_unawaited_paths: impl Display),
msg: format!("Not all paths through the function run all Finals. {num_unawaited_paths}/{num_total_paths} paths contain at least one Final that is never run."),
help: Some("Ex: `f.run()` to run a Final. Remove this warning by including the `--disable-conditional-branch-type-checking` flag.".to_string()),
}
@formatted
some_paths_contain_duplicate_final_runs {
args: (num_total_paths: impl Display, num_duplicate_await_paths: impl Display),
msg: format!("Some paths through the function contain duplicate Final runs. {num_duplicate_await_paths}/{num_total_paths} paths contain at least one Final that is run more than once."),
help: Some("Look at the times `.run()` is called, and try to reduce redundancies. Remove this warning by including the `--disable-conditional-branch-type-checking` flag.".to_string()),
}
@formatted
max_conditional_block_depth_exceeded {
args: (max: impl Display),
msg: format!("The type checker has exceeded the max depth of nested conditional blocks: {max}."),
help: Some("Re-run with a larger maximum depth using the `--conditional_block_max_depth` build option. Ex: `leo run main --conditional_block_max_depth 25`.".to_string()),
}
@formatted
final_not_awaited_in_order {
args: (future_name: impl Display),
msg: format!("The Final `{}` is not run in the order in which they were passed in to the function.", future_name),
help: Some("While it is not required for futures to be run in order, there is some specific behavior that arises, which may affect the semantics of your program. See `https: }
);