Constrain and solve import params

No reporting yet
This commit is contained in:
Agus Zubiaga 2024-06-27 18:27:33 -03:00
parent c541dd5747
commit 5ec4b042bb
No known key found for this signature in database
18 changed files with 238 additions and 26 deletions

View file

@ -602,7 +602,8 @@ impl Constraints {
| Constraint::Exhaustive { .. }
| Constraint::Resolve(..)
| Constraint::IngestedFile(..)
| Constraint::CheckCycle(..) => false,
| Constraint::CheckCycle(..)
| Constraint::ImportParams(..) => false,
}
}
@ -685,6 +686,15 @@ impl Constraints {
) -> Constraint {
Constraint::IngestedFile(type_index, file_path, bytes)
}
pub fn import_params(
&mut self,
type_index: TypeOrVar,
module_id: ModuleId,
region: Region,
) -> Constraint {
Constraint::ImportParams(type_index, module_id, region)
}
}
roc_error_macros::assert_sizeof_default!(Constraint, 3 * 8);
@ -787,6 +797,7 @@ pub enum Constraint {
CheckCycle(Index<Cycle>, IllegalCycleMark),
IngestedFile(TypeOrVar, Box<PathBuf>, Arc<Vec<u8>>),
ImportParams(TypeOrVar, ModuleId, Region),
}
#[derive(Debug, Clone, Copy, Default)]
@ -865,6 +876,9 @@ impl std::fmt::Debug for Constraint {
Self::IngestedFile(arg0, arg1, arg2) => {
write!(f, "IngestedFile({arg0:?}, {arg1:?}, {arg2:?})")
}
Self::ImportParams(arg0, arg1, arg2) => {
write!(f, "ImportParams({arg0:?}, {arg1:?}, {arg2:?})")
}
}
}
}