Constrain function annotation fx to body

This commit is contained in:
Agus Zubiaga 2024-10-10 19:49:48 -03:00
parent b9b85a222f
commit 7af05cc6c9
No known key found for this signature in database
10 changed files with 102 additions and 87 deletions

View file

@ -606,8 +606,7 @@ impl Constraints {
| Constraint::Resolve(..)
| Constraint::IngestedFile(..)
| Constraint::CheckCycle(..)
| Constraint::ImportParams(..)
| Constraint::CallFx(_, _) => false,
| Constraint::ImportParams(..) => false,
}
}
@ -699,10 +698,6 @@ impl Constraints {
) -> Constraint {
Constraint::ImportParams(opt_type_index, module_id, region)
}
pub fn call_fx(&mut self, env_fx_var: Variable, call_fx_var: Variable) -> Constraint {
Constraint::CallFx(env_fx_var, call_fx_var)
}
}
roc_error_macros::assert_sizeof_default!(Constraint, 3 * 8);
@ -775,8 +770,6 @@ pub enum Constraint {
Index<PatternCategory>,
Region,
),
/// Unify the current function fx var with a call fx var
CallFx(Variable, Variable),
/// Used for things that always unify, e.g. blanks and runtime errors
True,
SaveTheEnvironment,
@ -865,9 +858,6 @@ impl std::fmt::Debug for Constraint {
Self::Pattern(arg0, arg1, arg2, arg3) => {
write!(f, "Pattern({arg0:?}, {arg1:?}, {arg2:?}, {arg3:?})")
}
Self::CallFx(arg0, arg1) => {
write!(f, "CallFx({arg0:?}, {arg1:?})")
}
Self::True => write!(f, "True"),
Self::SaveTheEnvironment => write!(f, "SaveTheEnvironment"),
Self::Let(arg0, arg1) => f.debug_tuple("Let").field(arg0).field(arg1).finish(),