Unwrap rec pointers when getting lambda set

This commit is contained in:
Ayaz Hafiz 2023-06-29 14:51:29 -05:00
parent 1bede92e68
commit e27a06849d
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58

View file

@ -2163,10 +2163,15 @@ impl Subs {
self.utable.vars_since_snapshot(&snapshot.utable_snapshot)
}
pub fn get_lambda_set(&self, lambda_set: Variable) -> LambdaSet {
match self.get_content_without_compacting(lambda_set) {
Content::LambdaSet(lambda_set) => *lambda_set,
_ => internal_error!("not a lambda set"),
pub fn get_lambda_set(&self, mut lambda_set: Variable) -> LambdaSet {
loop {
match self.get_content_without_compacting(lambda_set) {
Content::LambdaSet(lambda_set) => return *lambda_set,
Content::RecursionVar { structure, .. } => {
lambda_set = *structure;
}
_ => internal_error!("not a lambda set"),
}
}
}