Update error text

This commit is contained in:
Sofia 2025-07-19 19:02:42 +03:00
parent 98169af415
commit f9f9360efc
2 changed files with 7 additions and 5 deletions

View File

@ -26,9 +26,9 @@ pub enum ErrorKind {
FunctionNotDefined(String), FunctionNotDefined(String),
#[error("Expected a return type of {0}, got {1} instead")] #[error("Expected a return type of {0}, got {1} instead")]
ReturnTypeMismatch(TypeKind, TypeKind), ReturnTypeMismatch(TypeKind, TypeKind),
#[error("Function not defined: {0}")] #[error("Function already defined: {0}")]
FunctionAlreadyDefined(String), FunctionAlreadyDefined(String),
#[error("Variable not defined: {0}")] #[error("Variable already defined: {0}")]
VariableAlreadyDefined(String), VariableAlreadyDefined(String),
#[error("Variable {0} is not declared as mutable")] #[error("Variable {0} is not declared as mutable")]
VariableNotMutable(String), VariableNotMutable(String),

View File

@ -7,8 +7,10 @@ fn array() -> [[[u16; 4];1];1] {
fn main() -> u16 { fn main() -> u16 {
let mut list = array(); let mut list = array();
list[0][0][2] = 19; let a = [[[5, 3, 2]]];
let a = 1;
return list[0][0][a + 1]; list[0][0][2] = 19;
// let a = 1;
return a[0][0][1];
} }