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!(), 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!") 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 { let outer_symbol = env.unique_symbol();
store_pattern(env, procs, layout_cache, &mono_pattern, outer_symbol, stmt) stmt = 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);
// convert the def body, store in outer_symbol // convert the def body, store in outer_symbol
with_hole( with_hole(
env, env,
def.loc_expr.value, def.loc_expr.value,
def.expr_var, def.expr_var,
procs, procs,
layout_cache, layout_cache,
outer_symbol, outer_symbol,
env.arena.alloc(stmt), env.arena.alloc(stmt),
) )
}
} }
_ => { _ => {