mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-02 16:21:11 +00:00
Working pattern match on Result Int Int
This commit is contained in:
parent
53bd47221c
commit
99db336033
6 changed files with 44 additions and 88 deletions
|
@ -738,8 +738,10 @@ fn decide_to_branching<'a>(
|
|||
Test::IsCtor { tag_id, union, .. } => {
|
||||
let lhs = Expr::Int(tag_id as i64);
|
||||
|
||||
// NOTE this is hardcoded, and should be made dynamic
|
||||
let field_layouts = env.arena.alloc([
|
||||
Layout::Builtin(Builtin::Byte(MutMap::default())),
|
||||
Layout::Builtin(Builtin::Int64),
|
||||
Layout::Builtin(Builtin::Int64),
|
||||
Layout::Builtin(Builtin::Int64),
|
||||
]);
|
||||
let rhs = Expr::AccessAtIndex {
|
||||
|
@ -748,7 +750,6 @@ fn decide_to_branching<'a>(
|
|||
expr: env.arena.alloc(Expr::Load(cond_symbol)),
|
||||
is_unwrapped: union.alternatives.len() == 1,
|
||||
};
|
||||
// let rhs = Expr::Byte(tag_id);
|
||||
|
||||
let cond = env.arena.alloc(Expr::CallByName(
|
||||
Symbol::INT_EQ_I64,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue