Drop another unused branch

This commit is contained in:
Ayaz Hafiz 2022-05-07 15:04:35 -04:00
parent 7e58c4ddea
commit 19175a85d8
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58

View file

@ -5867,7 +5867,9 @@ pub fn from_can<'a>(
Err(_) => todo!(),
};
if let Pattern::Identifier(_symbol) = mono_pattern {
if matches!(mono_pattern, Pattern::Identifier(_symbol))
|| matches!(def.loc_expr.value, roc_can::expr::Expr::Var(..))
{
internal_error!("Identifier patterns should be handled in a higher code pass!")
}
@ -5895,23 +5897,19 @@ pub fn from_can<'a>(
);
}
if let roc_can::expr::Expr::Var(outer_symbol) = def.loc_expr.value {
store_pattern(env, procs, layout_cache, &mono_pattern, outer_symbol, stmt)
} else {
let outer_symbol = env.unique_symbol();
stmt = store_pattern(env, procs, layout_cache, &mono_pattern, outer_symbol, stmt);
let outer_symbol = env.unique_symbol();
stmt = store_pattern(env, procs, layout_cache, &mono_pattern, outer_symbol, stmt);
// convert the def body, store in outer_symbol
with_hole(
env,
def.loc_expr.value,
def.expr_var,
procs,
layout_cache,
outer_symbol,
env.arena.alloc(stmt),
)
}
// convert the def body, store in outer_symbol
with_hole(
env,
def.loc_expr.value,
def.expr_var,
procs,
layout_cache,
outer_symbol,
env.arena.alloc(stmt),
)
}
_ => {