hardcode Bool

This commit is contained in:
Folkert 2020-03-10 14:50:35 +01:00
parent fef590b9f7
commit 7fea957979
8 changed files with 34 additions and 26 deletions

View file

@ -10,7 +10,7 @@ use roc_can::expr::Expr::{self, *};
use roc_can::expr::Field;
use roc_can::pattern::Pattern;
use roc_collections::all::{ImMap, SendMap};
use roc_module::ident::{Lowercase, TagName};
use roc_module::ident::Lowercase;
use roc_module::symbol::{ModuleId, Symbol};
use roc_region::all::{Located, Region};
use roc_types::subs::Variable;
@ -318,14 +318,7 @@ pub fn constrain_expr(
branches,
final_else,
} => {
// TODO use Bool alias here, so we don't allocate this type every time
let bool_type = Type::TagUnion(
vec![
(TagName::Global("True".into()), vec![]),
(TagName::Global("False".into()), vec![]),
],
Box::new(Type::EmptyTagUnion),
);
let bool_type = Type::Variable(Variable::BOOL);
let expect_bool = Expected::ForReason(Reason::IfCondition, bool_type, region);
let mut branch_cons = Vec::with_capacity(2 * branches.len() + 2);