Typechecking shouldn't fail yet
This commit is contained in:
parent
bc80c8f9ad
commit
ff0294c56e
@ -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> {
|
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| {
|
comp.map(|comp| {
|
||||||
let artifact = TraceArtifact::new("type", ty);
|
let artifact = TraceArtifact::new("type", format!("{:?}", result));
|
||||||
comp.add_artifact(artifact);
|
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> {
|
fn ast_reducing(handle: &mut Schala, input: ast::AST, comp: Option<&mut UnfinishedComputation>) -> Result<reduced_ast::ReducedAST, String> {
|
||||||
|
Loading…
Reference in New Issue
Block a user