mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-04 04:08:19 +00:00
Desugar stmt expr before checking whether it's suffixed
This commit is contained in:
parent
01c94050c8
commit
460fa693fd
3 changed files with 12 additions and 6 deletions
|
@ -207,7 +207,9 @@ fn desugar_value_def<'a>(
|
|||
// _ : {}
|
||||
// _ = stmt_expr!
|
||||
|
||||
if env.fx_mode == FxMode::Task && !is_expr_suffixed(&stmt_expr.value) {
|
||||
let desugared_expr = desugar_expr(env, scope, stmt_expr);
|
||||
|
||||
if env.fx_mode == FxMode::Task && !is_expr_suffixed(&desugared_expr.value) {
|
||||
env.problems.push(Problem::StmtAfterExpr(stmt_expr.region));
|
||||
|
||||
return ValueDef::StmtAfterExpr;
|
||||
|
@ -229,7 +231,7 @@ fn desugar_value_def<'a>(
|
|||
)),
|
||||
lines_between: &[],
|
||||
body_pattern: new_pat,
|
||||
body_expr: desugar_expr(env, scope, stmt_expr),
|
||||
body_expr: desugared_expr,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue