mirror of
https://github.com/AleoHQ/leo.git
synced 2024-11-12 22:48:37 +03:00
revise errors to allow stubs more leeway in parsing
This commit is contained in:
parent
fb56a4f429
commit
0de4e81cc2
@ -252,7 +252,7 @@ create_messages!(
|
||||
@formatted
|
||||
invalid_network {
|
||||
args: (),
|
||||
msg: "Invalid network identifier. The only supported identifier is `aleo`.",
|
||||
msg: "Invalid network identifier. The only supported identifier is `.aleo`.",
|
||||
help: None,
|
||||
}
|
||||
|
||||
@ -300,14 +300,6 @@ create_messages!(
|
||||
help: None,
|
||||
}
|
||||
|
||||
/// Enforce that cannot use an external type to do anything except input/output of function
|
||||
@formatted
|
||||
external_type_cannot_be_used_inside_function {
|
||||
args: (program: impl Display, file_type: impl Display),
|
||||
msg: format!("External types cannot be used inside function (only as input/output types) -- found exported type from '{program}.{file_type}'."),
|
||||
help: None,
|
||||
}
|
||||
|
||||
/// Enforce that cannot use import in program scope
|
||||
@formatted
|
||||
cannot_import_inside_program_body {
|
||||
@ -322,4 +314,18 @@ create_messages!(
|
||||
msg: format!("An array {kind} must have at least one element."),
|
||||
help: None,
|
||||
}
|
||||
|
||||
@formatted
|
||||
invalid_external_type {
|
||||
args: (),
|
||||
msg: format!("Invalid external type."),
|
||||
help: Some("External type should have the form `<program>.aleo/<record>`. For example `bank.aleo/loan`".to_string()),
|
||||
}
|
||||
|
||||
@formatted
|
||||
cannot_declare_external_struct {
|
||||
args: (),
|
||||
msg: format!("Cannot declare external struct."),
|
||||
help: None,
|
||||
}
|
||||
);
|
||||
|
@ -454,7 +454,7 @@ create_messages!(
|
||||
help: None,
|
||||
}
|
||||
|
||||
// TODO: Consider chainging this to a warning.
|
||||
// TODO: Consider changing this to a warning.
|
||||
|
||||
@formatted
|
||||
assign_unit_expression_to_variable {
|
||||
@ -685,13 +685,6 @@ create_messages!(
|
||||
help: None,
|
||||
}
|
||||
|
||||
@formatted
|
||||
stubs_can_only_have_records_and_transitions {
|
||||
args: (found: impl Display),
|
||||
msg: format!("Stubs can only have records, transitions, functions and imports -- found {found}"),
|
||||
help: None,
|
||||
}
|
||||
|
||||
@formatted
|
||||
stub_functions_must_not_be_inlines {
|
||||
args: (),
|
||||
@ -706,13 +699,6 @@ create_messages!(
|
||||
help: None,
|
||||
}
|
||||
|
||||
@formatted
|
||||
stub_functions_must_have_no_finalize {
|
||||
args: (),
|
||||
msg: format!("Function stubs must not have finalize blocks"),
|
||||
help: None,
|
||||
}
|
||||
|
||||
@formatted
|
||||
array_empty {
|
||||
args: (),
|
||||
@ -740,4 +726,18 @@ create_messages!(
|
||||
msg: format!("An array cannot have a record as an element type"),
|
||||
help: None,
|
||||
}
|
||||
|
||||
@formatted
|
||||
stubs_cannot_have_non_record_structs {
|
||||
args: (),
|
||||
msg: format!("Stubs can only have records, transitions, functions, mappings and imports -- found non-record struct"),
|
||||
help: None,
|
||||
}
|
||||
|
||||
@formatted
|
||||
stubs_cannot_have_const_declarations {
|
||||
args: (),
|
||||
msg: format!("Stubs can only have records, transitions, functions, mappings and imports -- found const declaration"),
|
||||
help: None,
|
||||
}
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user