From 887ba46b0b8785d5bb7211540bdccd790e5f12a1 Mon Sep 17 00:00:00 2001 From: greg Date: Mon, 21 May 2018 12:21:42 -0700 Subject: [PATCH] Fix this thing --- schala-lang/src/lib.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/schala-lang/src/lib.rs b/schala-lang/src/lib.rs index e6a5c2d..0c580fb 100644 --- a/schala-lang/src/lib.rs +++ b/schala-lang/src/lib.rs @@ -91,13 +91,17 @@ fn symbol_table(handle: &mut Schala, input: parsing::AST, comp: Option<&mut Unfi fn typechecking(handle: &mut Schala, input: parsing::AST, comp: Option<&mut UnfinishedComputation>) -> Result { match handle.type_context.type_check_ast(&input) { Ok(ty) => { - comp.map(|c| c.add_artifact(TraceArtifact::new("type_table", format!("{}", handle.type_context.debug_types())))); - comp.map(|c| c.add_artifact(TraceArtifact::new("type_check", format!("{:?}", ty)))); + comp.map(|c| { + c.add_artifact(TraceArtifact::new("type_table", format!("{}", handle.type_context.debug_types()))); + c.add_artifact(TraceArtifact::new("type_check", format!("{:?}", ty))); + }); Ok(input) }, Err(msg) => { - comp.map(|comp| comp.add_artifact(TraceArtifact::new("type_table", format!("{}", handle.type_context.debug_types())))); - comp.map(|comp| comp.add_artifact(TraceArtifact::new("type_check", format!("Type error: {:?}", msg)))); + comp.map(|comp| { + comp.add_artifact(TraceArtifact::new("type_table", format!("{}", handle.type_context.debug_types()))); + comp.add_artifact(TraceArtifact::new("type_check", format!("Type error: {:?}", msg))); + }); Ok(input) } }