Add unary operators

This commit is contained in:
Richard Feldman 2019-11-04 19:57:57 +01:00
parent 09c7d75f0d
commit 7ab7fdb88c
16 changed files with 277 additions and 135 deletions

View file

@ -108,12 +108,12 @@ fn type_to_variable<'a>(subs: &'a mut Subs, typ: Type) -> Variable {
subs.fresh(Descriptor::from(content))
}
Operator(box_type) => {
BinOp(box_type) => {
let op_type = *box_type;
let l_var = type_to_variable(subs, op_type.left);
let r_var = type_to_variable(subs, op_type.right);
let ret_var = type_to_variable(subs, op_type.ret);
let content = Content::Structure(FlatType::Operator(l_var, r_var, ret_var));
let content = Content::Structure(FlatType::BinOp(l_var, r_var, ret_var));
subs.fresh(Descriptor::from(content))
}