Compare commits
20 commits
4c1db87565
...
19e29759d2
Author | SHA1 | Date | |
---|---|---|---|
19e29759d2 | |||
b0ebf49d03 | |||
62a80fcd2f | |||
75aaf096eb | |||
804c688f4c | |||
2a8f7e0759 | |||
32ca645778 | |||
b869c5f59f | |||
bc1941d1bc | |||
27a0ca5e56 | |||
a144521566 | |||
d795ba45e9 | |||
8e6885197a | |||
81e87f111a | |||
802480d089 | |||
a0f71b1223 | |||
2ddd4c4a61 | |||
e962dfb41a | |||
b502b62479 | |||
f05ef07589 |
2 changed files with 2 additions and 1 deletions
src
|
@ -132,6 +132,7 @@ fn test_unification() {
|
|||
#[test]
|
||||
fn test_subtype_unification() {
|
||||
let mut dict = BimapTypeDict::new();
|
||||
|
||||
dict.add_varname(String::from("T"));
|
||||
dict.add_varname(String::from("U"));
|
||||
dict.add_varname(String::from("V"));
|
||||
|
|
|
@ -42,7 +42,6 @@ impl UnificationProblem {
|
|||
match (lhs.clone(), rhs.clone()) {
|
||||
(TypeTerm::TypeID(TypeID::Var(varid)), t) |
|
||||
(t, TypeTerm::TypeID(TypeID::Var(varid))) => {
|
||||
|
||||
if ! t.contains_var( varid ) {
|
||||
self.σ.insert(TypeID::Var(varid), t.clone());
|
||||
self.reapply_subst();
|
||||
|
@ -253,6 +252,7 @@ impl UnificationProblem {
|
|||
let mut halo_type = TypeTerm::Ladder(halo_rungs);
|
||||
halo_type = halo_type.normalize();
|
||||
halo_type = halo_type.apply_substitution(&|k| self.σ.get(k).cloned()).clone();
|
||||
|
||||
Ok((halo_type.param_normalize(), self.σ))
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue