Fix crash with int vars in canonicalization
This commit is contained in:
parent
f613c48d2e
commit
ced971ee9f
1 changed files with 6 additions and 1 deletions
|
@ -56,7 +56,12 @@ where
|
|||
self.var_stack.pop();
|
||||
result
|
||||
} else {
|
||||
let free_var = InferTy::TypeVar(self.ctx.var_unification_table.find(inner));
|
||||
let root = self.ctx.var_unification_table.find(inner);
|
||||
let free_var = match tv {
|
||||
InferTy::TypeVar(_) => InferTy::TypeVar(root),
|
||||
InferTy::IntVar(_) => InferTy::IntVar(root),
|
||||
InferTy::FloatVar(_) => InferTy::FloatVar(root),
|
||||
};
|
||||
let position = self.add(free_var);
|
||||
Ty::Bound(position as u32)
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue