pub struct TypeDiagnostic {
pub module: Option<String>,
pub line: u32,
pub column: u32,
pub end_line: u32,
pub end_column: u32,
pub message: String,
pub in_definitions: bool,
}Expand description
Static type-checking surface (the typecheck feature): the structured
TypeDiagnostic type plus the free check / check_with_definitions
helpers. The Lua/Chunk objects gain check / add_definitions methods
(see Lua::check / Chunk::check) that return
Error::TypeError.
One type-checker diagnostic with its source location (all 1-based).
Produced by check / check_with_definitions and carried inside
Error::TypeError. Unlike a flat error string,
the location fields let an editor / build tool point at the exact span.
Fields§
§module: Option<String>The module that produced this diagnostic, when the checker had one.
The simple check / check_with_definitions helpers preserve their
historical display shape and leave this empty for the synthetic "main"
module. Module-aware checks fill it for imported modules.
line: u321-based start line.
column: u321-based start column.
end_line: u321-based end line.
end_column: u321-based end column.
message: StringThe human-readable diagnostic message.
in_definitions: boolTrue when the diagnostic comes from the host declare definitions rather
than the checked script.
Trait Implementations§
Source§impl Clone for TypeDiagnostic
impl Clone for TypeDiagnostic
Source§fn clone(&self) -> TypeDiagnostic
fn clone(&self) -> TypeDiagnostic
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more