mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-29 14:54:47 +00:00
Fix error propagation
This commit is contained in:
parent
4e973b9236
commit
2b6039d683
1 changed files with 4 additions and 4 deletions
|
@ -91,7 +91,7 @@ where
|
||||||
// TODO: let the backend know of all the arguments.
|
// TODO: let the backend know of all the arguments.
|
||||||
self.calculate_last_seen(&proc.body);
|
self.calculate_last_seen(&proc.body);
|
||||||
//println!("{:?}", self.last_seen_map());
|
//println!("{:?}", self.last_seen_map());
|
||||||
self.build_stmt(&proc.body);
|
self.build_stmt(&proc.body)?;
|
||||||
self.finalize()
|
self.finalize()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -99,13 +99,13 @@ where
|
||||||
fn build_stmt(&mut self, stmt: &Stmt<'a>) -> Result<(), String> {
|
fn build_stmt(&mut self, stmt: &Stmt<'a>) -> Result<(), String> {
|
||||||
match stmt {
|
match stmt {
|
||||||
Stmt::Let(sym, expr, layout, following) => {
|
Stmt::Let(sym, expr, layout, following) => {
|
||||||
self.build_expr(sym, expr, layout);
|
self.build_expr(sym, expr, layout)?;
|
||||||
self.maybe_free_symbol(sym, stmt);
|
self.maybe_free_symbol(sym, stmt);
|
||||||
self.build_stmt(following);
|
self.build_stmt(following)?;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
Stmt::Ret(sym) => {
|
Stmt::Ret(sym) => {
|
||||||
self.return_symbol(sym);
|
self.return_symbol(sym)?;
|
||||||
self.maybe_free_symbol(sym, stmt);
|
self.maybe_free_symbol(sym, stmt);
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue