use crate::create_messages;
use std::{
error::Error as ErrorArg,
fmt::{Debug, Display},
};
create_messages!(
CompilerError,
code_mask: 6000i32,
code_prefix: "CMP",
@backtraced
file_read_error {
args: (path: impl Debug, error: impl ErrorArg),
msg: format!("Cannot read from the provided file path '{path:?}': {error}"),
help: None,
}
@formatted
illegal_static_member_assignment {
args: (member: impl Display),
msg: format!("Tried to assign to static member `{member}`"),
help: None,
}
@formatted
import_not_found {
args: (file_path: impl Display),
msg: format!("Attempted to import a file that does not exist `{file_path}`."),
help: None,
}
@formatted
cannot_open_cwd {
args: (err: impl ErrorArg),
msg: format!("Failed to open current working directory. Error: {err}"),
help: None,
}
@formatted
program_name_should_match_file_name {
args: (program_name: impl Display, file_name: impl Display),
msg: format!("Program name `{program_name}` should match file name `{file_name}`"),
help: None,
}
@formatted
program_scope_name_does_not_match {
args: (program_scope_name: impl Display, file_name: impl Display),
msg: format!("The program scope name `{program_scope_name}` must match `{file_name}`."),
help: None,
}
@formatted
imported_program_not_found {
args: (main_program_name: impl Display, dependency_name: impl Display),
msg: format!("`{main_program_name}` imports `{dependency_name}.aleo`, but `{dependency_name}.aleo` is not found in program manifest. Use `leo add --help` for more information on how to add a dependency."),
help: None,
}
);