diff --git a/reid-llvm-lib/src/compile.rs b/reid-llvm-lib/src/compile.rs index 9fba362..88eaf85 100644 --- a/reid-llvm-lib/src/compile.rs +++ b/reid-llvm-lib/src/compile.rs @@ -351,7 +351,6 @@ impl InstructionHolder { ), ArrayAlloca(ty, len) => { let array_len = ConstValue::U16(*len as u16).as_llvm(module.context_ref); - let array_ty = Type::Ptr(Box::new(ty.clone())); LLVMBuildArrayAlloca( module.builder_ref, ty.as_llvm(module.context_ref), diff --git a/reid/examples/reid/array.reid b/reid/examples/reid/array.reid index 624acff..4e04282 100644 --- a/reid/examples/reid/array.reid +++ b/reid/examples/reid/array.reid @@ -1,7 +1,7 @@ // Arithmetic, function calls and imports! -fn array() -> [[u16; 4]; 1] { - return [[10, 15, 7, 9]]; +fn array() -> [[[u16; 4]; 1]; 1] { + return [[[10, 15, 7, 9]]]; } fn main() -> u16 { @@ -9,7 +9,7 @@ fn main() -> u16 { let mut list = array(); - list[0][3] = 5; + list[0][0][3] = 5; - return list[0][3]; + return list[0][0][3]; } diff --git a/reid/src/codegen.rs b/reid/src/codegen.rs index 33a2878..e63da34 100644 --- a/reid/src/codegen.rs +++ b/reid/src/codegen.rs @@ -155,8 +155,6 @@ impl<'ctx, 'a> Scope<'ctx, 'a> { impl IndexedVariableReference { fn get_stack_value(&self, scope: &mut Scope) -> Option<(StackValue, Vec)> { - use StackValueKind as Kind; - match &self.kind { mir::IndexedVariableReferenceKind::Named(NamedVariableRef(_, name, _)) => scope .stack_values diff --git a/reid/src/mir/typeinference.rs b/reid/src/mir/typeinference.rs index 0b036fe..685c8ae 100644 --- a/reid/src/mir/typeinference.rs +++ b/reid/src/mir/typeinference.rs @@ -4,7 +4,7 @@ //! must then be passed through TypeCheck with the same [`TypeRefs`] in order to //! place the correct types from the IDs and check that there are no issues. -use std::{convert::Infallible, iter}; +use std::iter; use crate::{mir::TypeKind, util::try_all}; diff --git a/reid/src/mir/types.rs b/reid/src/mir/types.rs index 9c7d801..713605c 100644 --- a/reid/src/mir/types.rs +++ b/reid/src/mir/types.rs @@ -1,8 +1,4 @@ -use super::{ - pass::{ScopeVariable, Storage}, - typecheck::ErrorKind, - *, -}; +use super::*; #[derive(Debug, Clone)] pub enum ReturnTypeOther {