mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 14:24:45 +00:00
Constrain and solve import params
No reporting yet
This commit is contained in:
parent
c541dd5747
commit
5ec4b042bb
18 changed files with 238 additions and 26 deletions
|
@ -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:?})")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue