add boolean to Type and FlatType

This commit is contained in:
Folkert 2020-01-07 19:03:29 +01:00
parent 3268c267bd
commit 2b7a20bd23
3 changed files with 46 additions and 36 deletions

View file

@ -7,6 +7,7 @@ use crate::types::Constraint::{self, *};
use crate::types::Problem;
use crate::types::Type::{self, *};
use crate::unify::{unify, Unified};
use crate::uniqueness::boolean_algebra::Bool;
type Env = ImMap<Symbol, Variable>;
@ -401,6 +402,12 @@ fn type_to_variable(
register(subs, rank, pools, content)
}
Boolean(Bool::Variable(var)) => *var,
Boolean(b) => {
let content = Content::Structure(FlatType::Boolean(b.clone()));
register(subs, rank, pools, content)
}
Function(args, ret_type) => {
let mut arg_vars = Vec::with_capacity(args.len());