Restore some stuff to how it was before

This commit is contained in:
Richard Feldman 2019-10-17 08:55:35 -04:00
parent 695fb30021
commit 65f384cb6a
2 changed files with 32 additions and 39 deletions

View file

@ -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);
}
}
}
}