From ff0294c56e9a1b562c3b1cfabec3dc561f202a48 Mon Sep 17 00:00:00 2001 From: greg Date: Fri, 9 Nov 2018 02:02:08 -0800 Subject: [PATCH] Typechecking shouldn't fail yet --- schala-lang/language/src/lib.rs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/schala-lang/language/src/lib.rs b/schala-lang/language/src/lib.rs index 1802bb6..2c46bb2 100644 --- a/schala-lang/language/src/lib.rs +++ b/schala-lang/language/src/lib.rs @@ -129,15 +129,14 @@ fn symbol_table(handle: &mut Schala, input: ast::AST, comp: Option<&mut Unfinish } fn typechecking(handle: &mut Schala, input: ast::AST, comp: Option<&mut UnfinishedComputation>) -> Result { + let result = handle.type_context.typecheck(&input); - handle.type_context.typecheck(&input).map(|ty| { - comp.map(|comp| { - let artifact = TraceArtifact::new("type", ty); - comp.add_artifact(artifact); - }); + comp.map(|comp| { + let artifact = TraceArtifact::new("type", format!("{:?}", result)); + comp.add_artifact(artifact); + }); - input - }) + Ok(input) } fn ast_reducing(handle: &mut Schala, input: ast::AST, comp: Option<&mut UnfinishedComputation>) -> Result {