Fix shift_bound_vars
It should only shift free vars (maybe the name isn't the best...)
This commit is contained in:
parent
463df6720c
commit
c200025794
@ -814,13 +814,13 @@ fn shift_bound_vars(self, n: i32) -> Self
|
||||
where
|
||||
Self: Sized,
|
||||
{
|
||||
self.fold(&mut |ty| match ty {
|
||||
Ty::Bound(idx) => {
|
||||
self.fold_binders(&mut |ty, binders| match ty {
|
||||
Ty::Bound(idx) if idx as usize >= binders => {
|
||||
assert!(idx as i32 >= -n);
|
||||
Ty::Bound((idx as i32 + n) as u32)
|
||||
}
|
||||
ty => ty,
|
||||
})
|
||||
}, 0)
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user