Remove dead let-identifier code

This commit is contained in:
Ayaz Hafiz 2022-05-07 15:01:04 -04:00
parent 24279e12d0
commit 02bff35203
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58

View file

@ -15,6 +15,7 @@ use roc_debug_flags::{
dbg_do, ROC_PRINT_IR_AFTER_REFCOUNT, ROC_PRINT_IR_AFTER_RESET_REUSE, dbg_do, ROC_PRINT_IR_AFTER_REFCOUNT, ROC_PRINT_IR_AFTER_RESET_REUSE,
ROC_PRINT_IR_AFTER_SPECIALIZATION, ROC_PRINT_IR_AFTER_SPECIALIZATION,
}; };
use roc_error_macros::internal_error;
use roc_exhaustive::{Ctor, CtorName, Guard, RenderAs, TagId}; use roc_exhaustive::{Ctor, CtorName, Guard, RenderAs, TagId};
use roc_module::ident::{ForeignSymbol, Lowercase, TagName}; use roc_module::ident::{ForeignSymbol, Lowercase, TagName};
use roc_module::low_level::LowLevel; use roc_module::low_level::LowLevel;
@ -5867,26 +5868,9 @@ pub fn from_can<'a>(
}; };
if let Pattern::Identifier(symbol) = mono_pattern { if let Pattern::Identifier(symbol) = mono_pattern {
let mut hole = internal_error!("Identifier patterns should be handled in a higher code pass!")
env.arena
.alloc(from_can(env, variable, cont.value, procs, layout_cache));
for (symbol, variable, expr) in assignments {
let stmt = with_hole(env, expr, variable, procs, layout_cache, symbol, hole);
hole = env.arena.alloc(stmt);
} }
with_hole(
env,
def.loc_expr.value,
def.expr_var,
procs,
layout_cache,
symbol,
hole,
)
} else {
// convert the continuation // convert the continuation
let mut stmt = from_can(env, variable, cont.value, procs, layout_cache); let mut stmt = from_can(env, variable, cont.value, procs, layout_cache);
@ -5915,8 +5899,7 @@ pub fn from_can<'a>(
store_pattern(env, procs, layout_cache, &mono_pattern, outer_symbol, stmt) store_pattern(env, procs, layout_cache, &mono_pattern, outer_symbol, stmt)
} else { } else {
let outer_symbol = env.unique_symbol(); let outer_symbol = env.unique_symbol();
stmt = stmt = store_pattern(env, procs, layout_cache, &mono_pattern, outer_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(
@ -5930,7 +5913,6 @@ pub fn from_can<'a>(
) )
} }
} }
}
_ => { _ => {
let symbol = env.unique_symbol(); let symbol = env.unique_symbol();