mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-04 12:18:19 +00:00
Unwrap rec pointers when getting lambda set
This commit is contained in:
parent
1bede92e68
commit
e27a06849d
1 changed files with 9 additions and 4 deletions
|
@ -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"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue