diff --git a/schala-lang/language/src/schala.rs b/schala-lang/language/src/schala.rs index 6f4f5ff..b479ece 100644 --- a/schala-lang/language/src/schala.rs +++ b/schala-lang/language/src/schala.rs @@ -129,13 +129,12 @@ fn format_parse_error(error: parsing::ParseError, handle: &mut Schala) -> String } fn symbol_table(input: ast::AST, handle: &mut Schala, comp: Option<&mut PassDebugArtifact>) -> Result { - handle.symbol_table.borrow_mut().add_top_level_symbols(&input).map(|()| { - comp.map(|comp| { - let debug = handle.symbol_table.borrow().debug_symbol_table(); - comp.add_artifact(debug); - }); - input - }) + let () = handle.symbol_table.borrow_mut().add_top_level_symbols(&input)?; + comp.map(|comp| { + let debug = handle.symbol_table.borrow().debug_symbol_table(); + comp.add_artifact(debug); + }); + Ok(input) } fn typechecking(input: ast::AST, handle: &mut Schala, comp: Option<&mut PassDebugArtifact>) -> Result {