mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-03 19:58:18 +00:00
unwrap identity call
This commit is contained in:
parent
3e17168098
commit
a7ca02dd61
1 changed files with 6 additions and 6 deletions
|
@ -901,12 +901,6 @@ pub fn apply_task_await<'a>(
|
|||
arena.alloc(Loc::at(region, Defs(arena.alloc(defs), new_var)))
|
||||
}
|
||||
_ => {
|
||||
// If the pattern and the new are matching answers then we don't need to unwrap anything
|
||||
// e.g. `Task.await foo \#!a1 -> Task.ok #!a1` is the same as `foo`
|
||||
if is_matching_intermediate_answer(loc_pat, loc_cont) {
|
||||
return loc_expr;
|
||||
}
|
||||
|
||||
// loc_pat = loc_expr!
|
||||
// loc_cont
|
||||
|
||||
|
@ -916,6 +910,12 @@ pub fn apply_task_await<'a>(
|
|||
}
|
||||
};
|
||||
|
||||
// If the pattern and the new are matching answers then we don't need to unwrap anything
|
||||
// e.g. `Task.await foo \#!a1 -> Task.ok #!a1` is the same as `foo`
|
||||
if is_matching_intermediate_answer(loc_pat, loc_cont) {
|
||||
return task_await_first_arg;
|
||||
}
|
||||
|
||||
// \loc_pat -> loc_cont
|
||||
let closure = arena.alloc(Loc::at(region, Closure(arena.alloc([*loc_pat]), loc_cont)));
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue