mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-03 08:34:33 +00:00
Restore some stuff to how it was before
This commit is contained in:
parent
695fb30021
commit
65f384cb6a
2 changed files with 32 additions and 39 deletions
16
src/solve.rs
16
src/solve.rs
|
@ -4,9 +4,9 @@ use subs::{Content, Descriptor, FlatType, Subs, Variable};
|
|||
use types::Constraint::{self, *};
|
||||
use types::Type::{self, *};
|
||||
|
||||
type Env<'a> = ImMap<Symbol, Variable>;
|
||||
type Env = ImMap<Symbol, Variable>;
|
||||
|
||||
pub fn solve<'a>(env: &Env<'a>, subs: &mut Subs, constraint: &Constraint) {
|
||||
pub fn solve(env: &Env, subs: &mut Subs, constraint: &Constraint) {
|
||||
match constraint {
|
||||
True => (),
|
||||
Eq(typ, expected_type, _region) => {
|
||||
|
@ -26,12 +26,6 @@ pub fn solve<'a>(env: &Env<'a>, subs: &mut Subs, constraint: &Constraint) {
|
|||
|
||||
subs.union(actual, expected);
|
||||
}
|
||||
And(sub_constraints) => {
|
||||
// TODO drop And - we shouldn't need it anymore
|
||||
for sub_constraint in sub_constraints.iter() {
|
||||
solve(env, subs, sub_constraint);
|
||||
}
|
||||
}
|
||||
Let(let_con) => {
|
||||
match let_con.ret_constraint {
|
||||
True => {
|
||||
|
@ -66,6 +60,12 @@ pub fn solve<'a>(env: &Env<'a>, subs: &mut Subs, constraint: &Constraint) {
|
|||
}
|
||||
}
|
||||
}
|
||||
And(sub_constraints) => {
|
||||
// TODO drop And - we shouldn't need it anymore
|
||||
for sub_constraint in sub_constraints.iter() {
|
||||
solve(env, subs, sub_constraint);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue