diff --git a/dmc-lib/src/ast/class.rs b/dmc-lib/src/ast/class.rs index 37c0e3e..4742a28 100644 --- a/dmc-lib/src/ast/class.rs +++ b/dmc-lib/src/ast/class.rs @@ -13,9 +13,9 @@ use crate::error_codes::{FIELD_MULTIPLE_INIT, FIELD_UNINIT}; use crate::ir::ir_class::{IrClass, IrField}; use crate::ir::ir_function::IrFunction; use crate::source_range::SourceRange; +use crate::symbol::Symbol; use crate::symbol::class_symbol::ClassSymbol; use crate::symbol::constructor_symbol::ConstructorSymbol; -use crate::symbol::Symbol; use crate::symbol_table::SymbolTable; use crate::type_info::TypeInfo; use crate::types_table::TypesTable; @@ -147,7 +147,7 @@ impl Class { all_symbols } - pub fn check_names(&self, symbol_table: &mut SymbolTable) -> Vec { + pub fn check_names(&self, symbol_table: &SymbolTable) -> Vec { let mut diagnostics: Vec = Vec::new(); for generic_parameter in &self.generic_parameters { diff --git a/dmc-lib/src/ast/compilation_unit.rs b/dmc-lib/src/ast/compilation_unit.rs index ee9d658..895b9ec 100644 --- a/dmc-lib/src/ast/compilation_unit.rs +++ b/dmc-lib/src/ast/compilation_unit.rs @@ -57,7 +57,7 @@ impl CompilationUnit { symbol_table.pop_scope(); } - pub fn gather_symbols(&self) -> Vec { + pub fn gather_unordered_symbols(&self) -> Vec { let fqn_context = FqnContext::new(); [ self.classes diff --git a/dmc-lib/src/compile_pipeline.rs b/dmc-lib/src/compile_pipeline.rs index 075636b..0d17db3 100644 --- a/dmc-lib/src/compile_pipeline.rs +++ b/dmc-lib/src/compile_pipeline.rs @@ -40,10 +40,10 @@ pub fn compile_compilation_units(inputs: &HashMap) -> Result<(), compilation_unit.init_scopes(&mut symbol_table); } - // gather symbols + // gather unordered symbols let all_symbols = compilation_units .values() - .flat_map(|compilation_unit| compilation_unit.gather_symbols()) + .flat_map(|compilation_unit| compilation_unit.gather_unordered_symbols()) .collect::>(); try_insert_symbols_into(all_symbols, &mut symbol_table)?;