Enum brane_ast::errors::ResolveError
source · pub enum ResolveError {
Show 20 variants
VersionParseError {
err: ParseError,
range: TextRange,
},
UnknownPackageError {
name: String,
version: Version,
range: TextRange,
},
FunctionImportError {
package_name: String,
name: String,
err: SymbolTableError,
range: TextRange,
},
ClassImportError {
package_name: String,
name: String,
err: SymbolTableError,
range: TextRange,
},
FunctionDefineError {
name: String,
err: SymbolTableError,
range: TextRange,
},
ParameterDefineError {
func_name: String,
name: String,
err: SymbolTableError,
range: TextRange,
},
ClassDefineError {
name: String,
err: SymbolTableError,
range: TextRange,
},
UndefinedClass {
ident: String,
range: TextRange,
},
DuplicateMethodAndProperty {
c_name: String,
name: String,
new_range: TextRange,
existing_range: TextRange,
},
IllegalSelf {
c_name: String,
name: String,
arg: usize,
range: TextRange,
},
MissingSelf {
c_name: String,
name: String,
range: TextRange,
},
UnknownMergeStrategy {
raw: String,
range: TextRange,
},
VariableDefineError {
name: String,
err: SymbolTableError,
range: TextRange,
},
UndefinedFunction {
ident: String,
range: TextRange,
},
CommitResultIncorrectExpr {
range: TextRange,
},
NonClassProjection {
name: String,
got: DataType,
range: TextRange,
},
UnknownField {
class_name: String,
name: String,
range: TextRange,
},
DataIncorrectExpr {
range: TextRange,
},
UnknownDataError {
name: String,
range: TextRange,
},
UndefinedVariable {
ident: String,
range: TextRange,
},
}
Expand description
Defines errors that occur while building symbol tables.
Variants§
VersionParseError
Failed to parse a package version number.
UnknownPackageError
The given package/version pair was not found.
FunctionImportError
Failed to declare an imported package function
ClassImportError
Failed to declare an imported package class
FunctionDefineError
Failed to declare a new function.
ParameterDefineError
Failed to declare a new parameter for a function.
ClassDefineError
Failed to declare a new class.
UndefinedClass
The given class was not declared before.
DuplicateMethodAndProperty
A method has the same name as a property in this class.
IllegalSelf
A method haf a ‘self’ parameter but in an incorrect position.
MissingSelf
A method did not have a ‘self’ parameter.
UnknownMergeStrategy
Failed to parse the merge strategy.
VariableDefineError
Failed to declare a new variable.
UndefinedFunction
The given function was not declared before.
CommitResultIncorrectExpr
A commit_result()
did not have a string literal as ‘name’ field.
NonClassProjection
A project operator was used on a non-class type.
UnknownField
The given field is not known in the given class.
DataIncorrectExpr
A data structure did not have a string literal as ‘name’ field.
UnknownDataError
An unknown dataset was references.
UndefinedVariable
The given variable was not declared before.
Implementations§
source§impl ResolveError
impl ResolveError
sourcepub fn prettyprint(&self, file: impl AsRef<str>, source: impl AsRef<str>)
pub fn prettyprint(&self, file: impl AsRef<str>, source: impl AsRef<str>)
Prints the warning in a pretty way to stderr.
§Arguments
file
: The ‘path’ of the file (or some other identifier) where the source text originates from.source
: The source text to read the debug range from.
sourcepub fn prettywrite(
&self,
writer: impl Write,
file: impl AsRef<str>,
source: impl AsRef<str>,
) -> Result<(), Error>
pub fn prettywrite( &self, writer: impl Write, file: impl AsRef<str>, source: impl AsRef<str>, ) -> Result<(), Error>
Prints the warning in a pretty way to the given Write
r.
§Arguments:
writer
: TheWrite
-enabled object to write to.file
: The ‘path’ of the file (or some other identifier) where the source text originates from.source
: The source text to read the debug range from.
§Errors
This function may error if we failed to write to the given writer.
Trait Implementations§
source§impl Debug for ResolveError
impl Debug for ResolveError
source§impl Display for ResolveError
impl Display for ResolveError
source§impl Error for ResolveError
impl Error for ResolveError
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
source§impl From<ResolveError> for AstError
impl From<ResolveError> for AstError
source§fn from(err: ResolveError) -> Self
fn from(err: ResolveError) -> Self
Auto Trait Implementations§
impl Freeze for ResolveError
impl RefUnwindSafe for ResolveError
impl Send for ResolveError
impl Sync for ResolveError
impl Unpin for ResolveError
impl UnwindSafe for ResolveError
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request