Typechecking shouldn't fail yet

This commit is contained in:
greg 2018-11-09 02:02:08 -08:00
parent bc80c8f9ad
commit ff0294c56e

View File

@ -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<ast::AST, String> {
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<reduced_ast::ReducedAST, String> {