mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 06:14:46 +00:00
don't generate Store with no stores
This commit is contained in:
parent
ad23fc7e4b
commit
c202cf3e6b
1 changed files with 5 additions and 2 deletions
|
@ -376,7 +376,6 @@ fn from_can<'a>(
|
|||
name: Option<Symbol>,
|
||||
) -> Expr<'a> {
|
||||
use roc_can::expr::Expr::*;
|
||||
use roc_can::pattern::Pattern::*;
|
||||
|
||||
match can_expr {
|
||||
Num(var, num) => match to_int_or_float(env.subs, var) {
|
||||
|
@ -1002,7 +1001,11 @@ fn from_can_defs<'a>(
|
|||
// Extract Procs from the def body and the ret expression, and return the result!
|
||||
let ret = from_can(env, ret_expr.value, procs, None);
|
||||
|
||||
Expr::Store(stored.into_bump_slice(), arena.alloc(ret))
|
||||
if stored.is_empty() {
|
||||
ret
|
||||
} else {
|
||||
Expr::Store(stored.into_bump_slice(), arena.alloc(ret))
|
||||
}
|
||||
}
|
||||
|
||||
fn from_can_when<'a>(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue