mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 22:09:09 +00:00
Fix deriving of hash ability for recursive tag unions
This commit is contained in:
parent
02b02901bc
commit
2517695ce4
4 changed files with 25 additions and 8 deletions
|
@ -2937,7 +2937,6 @@ fn unify_flex_able<M: MetaCollector>(
|
|||
}
|
||||
|
||||
RigidVar(_) => mismatch!("FlexAble can never unify with non-able Rigid"),
|
||||
RecursionVar { .. } => mismatch!("FlexAble with RecursionVar"),
|
||||
LambdaSet(..) => mismatch!("FlexAble with LambdaSet"),
|
||||
|
||||
Alias(name, _args, _real_var, AliasKind::Opaque) => {
|
||||
|
@ -2952,7 +2951,10 @@ fn unify_flex_able<M: MetaCollector>(
|
|||
)
|
||||
}
|
||||
|
||||
Structure(_) | Alias(_, _, _, AliasKind::Structural) | RangedNumber(..) => {
|
||||
RecursionVar { .. }
|
||||
| Structure(_)
|
||||
| Alias(_, _, _, AliasKind::Structural)
|
||||
| RangedNumber(..) => {
|
||||
// Structural type wins.
|
||||
merge_flex_able_with_concrete(
|
||||
env,
|
||||
|
@ -3035,10 +3037,22 @@ fn unify_recursion<M: MetaCollector>(
|
|||
mismatch!("RecursionVar {:?} with rigid {:?}", ctx.first, &other)
|
||||
}
|
||||
|
||||
FlexAbleVar(..) | RigidAbleVar(..) => {
|
||||
RigidAbleVar(..) => {
|
||||
mismatch!("RecursionVar {:?} with able var {:?}", ctx.first, &other)
|
||||
}
|
||||
|
||||
FlexAbleVar(_, ability) => merge_flex_able_with_concrete(
|
||||
env,
|
||||
ctx,
|
||||
ctx.second,
|
||||
*ability,
|
||||
RecursionVar {
|
||||
structure,
|
||||
opt_name: *opt_name,
|
||||
},
|
||||
Obligated::Adhoc(ctx.first),
|
||||
),
|
||||
|
||||
FlexVar(_) => merge(
|
||||
env,
|
||||
ctx,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue