mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-04 00:54:36 +00:00
Add unary operators
This commit is contained in:
parent
09c7d75f0d
commit
7ab7fdb88c
16 changed files with 277 additions and 135 deletions
|
@ -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))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue