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