mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-02 16:21:11 +00:00
Infer multiple assignments
This commit is contained in:
parent
eae1f564db
commit
2e12651858
3 changed files with 31 additions and 11 deletions
|
@ -19,7 +19,7 @@ pub enum Type {
|
|||
Erroneous(Problem),
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
#[derive(Debug, Clone)]
|
||||
pub enum Expected<T> {
|
||||
NoExpectation(T),
|
||||
ForReason(Reason, T, Region),
|
||||
|
@ -34,7 +34,7 @@ impl<T> Expected<T> {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
#[derive(Debug, Clone)]
|
||||
pub enum Reason {
|
||||
OperatorLeftArg(Operator),
|
||||
OperatorRightArg(Operator),
|
||||
|
@ -43,7 +43,7 @@ pub enum Reason {
|
|||
ElemInList,
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
#[derive(Debug, Clone)]
|
||||
pub enum Constraint {
|
||||
Eq(Type, Expected<Type>, Region),
|
||||
Lookup(Symbol, Expected<Type>, Region),
|
||||
|
@ -52,7 +52,7 @@ pub enum Constraint {
|
|||
And(Vec<Constraint>)
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct LetConstraint {
|
||||
pub rigid_vars: Vec<Variable>,
|
||||
pub flex_vars: Vec<Variable>,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue