pub enum TypeError {
Show 18 variants
ProjOnNonClassError {
got: DataType,
range: TextRange,
},
UnexpectedMethod {
class_name: String,
name: String,
range: TextRange,
},
UnknownField {
class_name: String,
name: String,
range: TextRange,
},
IncorrectType {
got: DataType,
expected: DataType,
range: TextRange,
},
IllegalDataReturnError {
name: String,
range: TextRange,
},
IncompatibleReturns {
got: DataType,
expected: DataType,
got_range: TextRange,
expected_range: TextRange,
},
ParallelNoReturn {
block: usize,
range: TextRange,
},
ParallelUnexpectedReturn {
block: usize,
got: DataType,
range: TextRange,
},
ParallelIncompleteReturn {
block: usize,
expected: DataType,
range: TextRange,
},
ParallelIllegalType {
merge: MergeStrategy,
got: DataType,
expected: Vec<DataType>,
range: TextRange,
reason: TextRange,
},
ParallelNoStrategy {
range: TextRange,
},
NonFunctionCall {
got: DataType,
range: TextRange,
defined_range: TextRange,
},
UndefinedFunctionCall {
name: String,
range: TextRange,
},
FunctionArityError {
name: String,
got: usize,
expected: usize,
got_range: TextRange,
expected_range: TextRange,
},
InconsistentArrayError {
got: DataType,
expected: DataType,
got_range: TextRange,
expected_range: TextRange,
},
NonArrayIndexError {
got: DataType,
range: TextRange,
},
DataNameNotAStringError {
name: String,
got: Expr,
range: TextRange,
},
DataNoNamePropertyError {
name: String,
range: TextRange,
},
}
Expand description
Defines errors that occur during type checking.
Variants§
ProjOnNonClassError
The projection operator was used on a non-class variable.
UnexpectedMethod
A method was used as if it was a field.
UnknownField
The given field is not known in the given class.
IncorrectType
A type cannot be (implicitly) casted to another.
IllegalDataReturnError
An imported function returned a Data, while it cannot do that anymore.
IncompatibleReturns
The return statements of a function did not all return the same type.
ParallelNoReturn
A block in a parallel statement did not return while it should have.
ParallelUnexpectedReturn
A block in a parallel statement did return while it should not have.
ParallelIncompleteReturn
Not all blocks in a parallel statement return a non-void value.
ParallelIllegalType
The parallel returned the wrong value for the merge strategy
Fields
merge: MergeStrategy
ParallelNoStrategy
The parallel returns a value but the merge is None
NonFunctionCall
A function call has been attempted on a non-function.
UndefinedFunctionCall
The function identifier was not known.
FunctionArityError
A function was given an incorrect number of parameters.
InconsistentArrayError
An Array had confusing types
NonArrayIndexError
An Array Index was used on a non-array.
DataNameNotAStringError
The user specified something else as a Data than a literal string.
DataNoNamePropertyError
The user did not specify a name field in a Data or IntermediateResult field.
Implementations§
source§impl TypeError
impl TypeError
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 Error for TypeError
impl Error for TypeError
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
Auto Trait Implementations§
impl Freeze for TypeError
impl !RefUnwindSafe for TypeError
impl !Send for TypeError
impl !Sync for TypeError
impl Unpin for TypeError
impl !UnwindSafe for TypeError
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