[−][src]Enum oakc::mir::MirError
A value representing an error while assembling the MIR code
Variants
FunctionNotDefined(Identifier)
Calling a function without defining it
StructureRedefined(Identifier)
Defining a type multiple times
PrimitiveTypeRedefined(Identifier)
Defining a structure with the name of a primitive type
FunctionRedefined(Identifier)
Defining a function multiple times
VariableNotDefined(Identifier)
Using a variable without defining it
MethodRedefined(MirType, Identifier)
Defining a method multiple times for a type
MethodNotDefined(MirType, Identifier)
Calling a method for a type where it is not defined
StructureNotDefined(Identifier)
Using a structure name as a type without defining it If this were acceptable, the compiler would never know the size of the variable.
DereferenceNonPointer(MirType)
Dereferencing a non-pointer value
IndexVoidPointer(MirExpression)
Indexing a void pointer This is inherently bad because void pointers have size zero. Indexing them is the same as dereferencing, but less efficient.
AutoDefineVoidPointer(String, MirExpression)
Auto define a void pointer
This is less of a type error itself and more of a safety net.
Variables that hold the result of alloc
must be the proper
type for expressions like ptr[n]
to work.
DefineMismatchedType(String)
Mismatched types in a let
statement
AssignMismatchedType(MirExpression)
Mismatched types in an assignment statement
ArgumentMismatchedType(MirExpression)
Arguments to a function call do not match parameter types
FreeNonPointer(MirExpression)
Use a free
statement using an address argument
of a non-pointer type
NonBooleanCondition(MirExpression)
Using a non-boolean expression for an if statement, and if-else statement, a while loop, or a for loop
NonNumberAllocate(MirExpression)
Using a non-number for an alloc
call
NonNumberIndex(MirExpression)
Indexing an array with a non-number value
NonNumberBinaryOperation(MirExpression, MirExpression)
Adding, subtracting, multiplying, or dividing two values where one or more of them is not a number.
NonNumberUnaryOperation(MirExpression)
Using the not operator or other unary operator on a non-number value.
NotEnoughArguments(MirExpression)
Calling a function without enough arguments
TooManyArguments(MirExpression)
Calling a function with too many arguments
CalledFunctionAsMethod(String)
Calling an associated function, such as a constructor, as a method
MismatchedReturnType(String)
The return type of the function does not match the result of the function
MultipleReturns(String)
A function attempts to use multiple return statements
NonVoidExpressionNotUsed(MirExpression)
An expression with non-void type is pushed onto the stack without being used by another expression or statement.
MismatchedCastSize(MirExpression, MirType)
A bad typecast due to mismatched sizes in types. For example,
a value with size 3
cannot be cast to a number with size 1
OnlyOneBranchReturns(String)
Only one branch of an if-else statement returns in a function
IfReturns(String)
A single branch if-statement uses a return
LoopReturns(String)
Return statement used in a loop in a function
NonVoidNoReturn(String)
A non-void function never returns
MethodOnUnboundCopyDrop(MirExpression)
Prevent memory leaks by preventing the user from calling methods on objects that will not be dropped
MismatchedConditionalBranchTypes(MirExpression, MirExpression)
The branches of a conditional expression have different types
Trait Implementations
impl Clone for MirError
[src]
impl Debug for MirError
[src]
impl Display for MirError
[src]
Print an MIR error on the command line
impl PartialEq<MirError> for MirError
[src]
impl PartialOrd<MirError> for MirError
[src]
fn partial_cmp(&self, other: &MirError) -> Option<Ordering>
[src]
fn lt(&self, other: &MirError) -> bool
[src]
fn le(&self, other: &MirError) -> bool
[src]
fn gt(&self, other: &MirError) -> bool
[src]
fn ge(&self, other: &MirError) -> bool
[src]
impl StructuralPartialEq for MirError
[src]
Auto Trait Implementations
impl RefUnwindSafe for MirError
impl Send for MirError
impl Sync for MirError
impl Unpin for MirError
impl UnwindSafe for MirError
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Colorize for T where
T: Display,
[src]
T: Display,
fn black(self) -> String
[src]
fn red(self) -> String
[src]
fn green(self) -> String
[src]
fn yellow(self) -> String
[src]
fn blue(self) -> String
[src]
fn magenta(self) -> String
[src]
fn cyan(self) -> String
[src]
fn white(self) -> String
[src]
fn bright_black(self) -> String
[src]
fn bright_red(self) -> String
[src]
fn bright_green(self) -> String
[src]
fn bright_yellow(self) -> String
[src]
fn bright_blue(self) -> String
[src]
fn bright_magenta(self) -> String
[src]
fn bright_cyan(self) -> String
[src]
fn bright_white(self) -> String
[src]
fn bold(self) -> String
[src]
fn underline(self) -> String
[src]
fn invert(self) -> String
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,