Remove promotion to recursion var for lambda sets

This commit is contained in:
Ayaz Hafiz 2022-06-01 10:49:56 -05:00
parent 591528d8a3
commit b4bca5423b
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58

View file

@ -849,25 +849,7 @@ fn unify_lambda_set(
}
RecursionVar { structure, .. } => {
// suppose that the recursion var is a lambda set
let outcome = unify_pool(subs, pool, ctx.first, *structure, ctx.mode);
if outcome.mismatches.is_empty() {
debug_assert!(matches!(
subs.get_content_without_compacting(ctx.first),
Content::LambdaSet(self::LambdaSet { recursion_var, .. }) if recursion_var.into_variable().is_some()
));
let has_recursing_recursive_variable =
subs.occurs_including_recursion_vars(ctx.first).is_err();
if !has_recursing_recursive_variable {
merge(subs, ctx, *other)
} else {
outcome
}
} else {
outcome
}
unify_pool(subs, pool, ctx.first, *structure, ctx.mode)
}
RigidVar(..) | RigidAbleVar(..) => mismatch!("Lambda sets never unify with rigid"),
FlexAbleVar(..) => mismatch!("Lambda sets should never have abilities attached to them"),