diff --git a/reid/src/mir/typecheck.rs b/reid/src/mir/typecheck.rs index 45bf672..1e7cd80 100644 --- a/reid/src/mir/typecheck.rs +++ b/reid/src/mir/typecheck.rs @@ -26,9 +26,9 @@ pub enum ErrorKind { FunctionNotDefined(String), #[error("Expected a return type of {0}, got {1} instead")] ReturnTypeMismatch(TypeKind, TypeKind), - #[error("Function not defined: {0}")] + #[error("Function already defined: {0}")] FunctionAlreadyDefined(String), - #[error("Variable not defined: {0}")] + #[error("Variable already defined: {0}")] VariableAlreadyDefined(String), #[error("Variable {0} is not declared as mutable")] VariableNotMutable(String), diff --git a/reid_src/array.reid b/reid_src/array.reid index 990275b..0e494bc 100644 --- a/reid_src/array.reid +++ b/reid_src/array.reid @@ -7,8 +7,10 @@ fn array() -> [[[u16; 4];1];1] { fn main() -> u16 { let mut list = array(); - list[0][0][2] = 19; - let a = 1; + let a = [[[5, 3, 2]]]; - return list[0][0][a + 1]; + list[0][0][2] = 19; + // let a = 1; + + return a[0][0][1]; }