Unify var-const
This commit is contained in:
parent
be175a2b75
commit
452f2ab188
@ -359,7 +359,8 @@ impl<'a> TypeContext<'a> {
|
||||
match (t1, t2) {
|
||||
(Const(ref c1), Const(ref c2)) if c1 == c2 => Ok(Const(c1.clone())), //choice of c1 is arbitrary I *think*
|
||||
(Const(ref c1), Var(ref v2)) => {
|
||||
//TODO flesh this out!
|
||||
self.unification_table.unify_var_value(v2.clone(), Some(c1.clone()))
|
||||
.or_else(|_| TypeError::new(format!("Couldn't unify {:?} and {:?}", Const(c1.clone()), Var(*v2))))?;
|
||||
Ok(Const(c1.clone()))
|
||||
},
|
||||
(a @ Var(_), b @ Const(_)) => self.unify(b, a),
|
||||
|
Loading…
Reference in New Issue
Block a user