mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-03 11:52:19 +00:00
Enforce some simplifications
This commit is contained in:
parent
7ff180c1a5
commit
76f7843c93
4 changed files with 7 additions and 27 deletions
|
@ -2651,21 +2651,9 @@ fn specialize_suspended<'a>(
|
|||
v
|
||||
}
|
||||
None => {
|
||||
if env.home == ModuleId::DERIVED_SYNTH
|
||||
&& name.name().module_id() == ModuleId::DERIVED_SYNTH
|
||||
{
|
||||
// TODO: This can happen when we find another symbol to derive, but haven't
|
||||
// yet derived it. We don't need this branch if we make deriving closer to
|
||||
// mono and have derived impls assembled into procs here, rather than in
|
||||
// load.
|
||||
// But for now, just mark as an external specialization and we'll
|
||||
// specialize it in a subsequent pass of mono.
|
||||
add_needed_external(procs, env, var, name);
|
||||
} else {
|
||||
// TODO this assumes the specialization is done by another module
|
||||
// make sure this does not become a problem down the road!
|
||||
debug_assert!(name.name().module_id() != name.name().module_id());
|
||||
}
|
||||
// TODO this assumes the specialization is done by another module
|
||||
// make sure this does not become a problem down the road!
|
||||
debug_assert!(name.name().module_id() != name.name().module_id());
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1235,9 +1235,7 @@ impl<'a> Layout<'a> {
|
|||
use roc_types::subs::Content::*;
|
||||
match content {
|
||||
FlexVar(_) | RigidVar(_) => Err(LayoutProblem::UnresolvedTypeVar(var)),
|
||||
FlexAbleVar(_, _) | RigidAbleVar(_, _) => {
|
||||
todo_abilities!("Not reachable yet")
|
||||
}
|
||||
FlexAbleVar(_, _) | RigidAbleVar(_, _) => todo_abilities!("Not reachable yet"),
|
||||
RecursionVar { structure, .. } => {
|
||||
let structure_content = env.subs.get_content_without_compacting(structure);
|
||||
Self::new_help(env, structure, *structure_content)
|
||||
|
|
|
@ -2103,7 +2103,7 @@ fn compact_lambda_set<P: Phase>(
|
|||
}
|
||||
};
|
||||
|
||||
let specialized_lambda_set = get_specialization_lambda_set_ambient_function(
|
||||
let specialization_ambient_function_var = get_specialization_lambda_set_ambient_function(
|
||||
subs,
|
||||
derived_module,
|
||||
phase,
|
||||
|
@ -2114,7 +2114,7 @@ fn compact_lambda_set<P: Phase>(
|
|||
target_rank,
|
||||
);
|
||||
|
||||
let t_f2 = match specialized_lambda_set {
|
||||
let t_f2 = match specialization_ambient_function_var {
|
||||
Ok(lset) => lset,
|
||||
Err(()) => {
|
||||
// Do nothing other than to remove the concrete lambda to drop from the lambda set,
|
||||
|
|
|
@ -873,13 +873,7 @@ fn subs_fmt_flat_type(this: &FlatType, subs: &Subs, f: &mut fmt::Formatter) -> f
|
|||
FlatType::Apply(name, arguments) => {
|
||||
let slice = subs.get_subs_slice(*arguments);
|
||||
|
||||
write!(f, "Apply({:?} ", name)?;
|
||||
for var in slice {
|
||||
let content = subs.get_content_without_compacting(*var);
|
||||
write!(f, ", <{:?}>{:?}", *var, SubsFmtContent(content, subs))?;
|
||||
}
|
||||
write!(f, ")")
|
||||
// write!(f, "Apply({:?}, {:?})", name, slice)
|
||||
write!(f, "Apply({:?}, {:?})", name, slice)
|
||||
}
|
||||
FlatType::Func(arguments, lambda_set, result) => {
|
||||
let slice = subs.get_subs_slice(*arguments);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue