mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-29 23:04:49 +00:00
use GetTagId in one more place
This commit is contained in:
parent
aecb509909
commit
454241a04f
3 changed files with 8 additions and 53 deletions
|
@ -1746,7 +1746,7 @@ fn decide_to_branching<'a>(
|
|||
|
||||
// We have learned more about the exact layout of the cond (based on the path)
|
||||
// but tests are still relative to the original cond symbol
|
||||
let mut switch = if let Layout::Union(_) = inner_cond_layout {
|
||||
let mut switch = if let Layout::Union(union_layout) = inner_cond_layout {
|
||||
let tag_id_symbol = env.unique_symbol();
|
||||
|
||||
let temp = Stmt::Switch {
|
||||
|
@ -1757,11 +1757,9 @@ fn decide_to_branching<'a>(
|
|||
ret_layout,
|
||||
};
|
||||
|
||||
let expr = Expr::AccessAtIndex {
|
||||
index: 0,
|
||||
field_layouts: &[Layout::TAG_SIZE],
|
||||
let expr = Expr::GetTagId {
|
||||
structure: inner_cond_symbol,
|
||||
wrapped: Wrapped::MultiTagUnion,
|
||||
union_layout,
|
||||
};
|
||||
|
||||
Stmt::Let(tag_id_symbol, expr, Layout::TAG_SIZE, env.arena.alloc(temp))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue