mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-29 06:44:46 +00:00
even more wip
This commit is contained in:
parent
b8fd6992a2
commit
01a7fe77d4
10 changed files with 2710 additions and 64 deletions
|
@ -360,8 +360,7 @@ fn can_annotation_help(
|
|||
As(
|
||||
loc_inner,
|
||||
_spaces,
|
||||
alias_header
|
||||
@ TypeHeader {
|
||||
alias_header @ TypeHeader {
|
||||
name,
|
||||
vars: loc_vars,
|
||||
},
|
||||
|
|
|
@ -133,7 +133,7 @@ impl Constraints {
|
|||
Constraint::Let(let_index)
|
||||
}
|
||||
|
||||
pub fn let_contraint<I1, I2, I3>(
|
||||
pub fn let_constraint<I1, I2, I3>(
|
||||
&mut self,
|
||||
rigid_vars: I1,
|
||||
flex_vars: I2,
|
||||
|
@ -164,7 +164,7 @@ impl Constraints {
|
|||
Constraint::Let(let_index)
|
||||
}
|
||||
|
||||
pub fn and_contraint<I>(&mut self, constraints: I) -> Constraint
|
||||
pub fn and_constraint<I>(&mut self, constraints: I) -> Constraint
|
||||
where
|
||||
I: IntoIterator<Item = Constraint>,
|
||||
{
|
||||
|
@ -178,6 +178,36 @@ impl Constraints {
|
|||
|
||||
Constraint::And(slice)
|
||||
}
|
||||
|
||||
pub fn lookup(
|
||||
&mut self,
|
||||
symbol: Symbol,
|
||||
expected: Expected<Type>,
|
||||
region: Region,
|
||||
) -> Constraint {
|
||||
Constraint::Lookup(
|
||||
symbol,
|
||||
Index::push_new(&mut self.expectations, expected),
|
||||
region,
|
||||
)
|
||||
}
|
||||
pub fn contains_save_the_environment(&self, constraint: Constraint) -> bool {
|
||||
todo!()
|
||||
}
|
||||
|
||||
pub fn store(
|
||||
&mut self,
|
||||
typ: Type,
|
||||
variable: Variable,
|
||||
filename: &'static str,
|
||||
line_number: u32,
|
||||
) -> Constraint {
|
||||
let type_index = Index::new(self.types.len() as _);
|
||||
|
||||
self.types.push(typ);
|
||||
|
||||
Constraint::Store(type_index, variable, filename, line_number)
|
||||
}
|
||||
}
|
||||
|
||||
static_assertions::assert_eq_size!([u8; 4 * 8], Constraint);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue