mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 06:14:46 +00:00
Unify call's fx var with that of the enclosing function
This commit is contained in:
parent
7871ba182d
commit
5a5abe3bc5
23 changed files with 246 additions and 41 deletions
|
@ -606,7 +606,8 @@ impl Constraints {
|
|||
| Constraint::Resolve(..)
|
||||
| Constraint::IngestedFile(..)
|
||||
| Constraint::CheckCycle(..)
|
||||
| Constraint::ImportParams(..) => false,
|
||||
| Constraint::ImportParams(..)
|
||||
| Constraint::CallFx(_, _) => false,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -698,6 +699,10 @@ 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);
|
||||
|
@ -770,6 +775,8 @@ 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,
|
||||
|
@ -858,6 +865,9 @@ 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(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue