Gen tests for promoted num layouts

This commit is contained in:
Ayaz Hafiz 2022-07-04 19:03:31 -04:00 committed by ayazhafiz
parent ba450367ca
commit 2492fba9f9
No known key found for this signature in database
GPG key ID: B443F7A3030C9AED
5 changed files with 79 additions and 16 deletions

View file

@ -510,12 +510,13 @@ fn unify_ranged_number<M: MetaCollector>(
// Ranged number wins
merge(subs, ctx, RangedNumber(range_vars))
}
RecursionVar { .. }
| RigidVar(..)
| Alias(..)
| Structure(..)
| RigidAbleVar(..)
| FlexAbleVar(..) => check_and_merge_valid_range(subs, ctx, ctx.second, range_vars),
RigidVar(name) => {
// Int a vs Int <range>, the rigid wins
merge(subs, ctx, RigidVar(*name))
}
RecursionVar { .. } | Alias(..) | Structure(..) | RigidAbleVar(..) | FlexAbleVar(..) => {
check_and_merge_valid_range(subs, ctx, ctx.second, range_vars)
}
&RangedNumber(other_range_vars) => match range_vars.intersection(&other_range_vars) {
Some(range) => merge(subs, ctx, RangedNumber(range)),
None => not_in_range_mismatch(),
@ -2206,13 +2207,16 @@ fn unify_rigid<M: MetaCollector>(
"Rigid {:?} with FlexAble {:?}", ctx.first, other
)
}
RangedNumber(..) => {
// Int a vs Int <range>, the rigid wins
merge(subs, ctx, RigidVar(*name))
}
RigidVar(_)
| RigidAbleVar(..)
| RecursionVar { .. }
| Structure(_)
| Alias(..)
| RangedNumber(..)
| LambdaSet(..) => {
// Type mismatch! Rigid can only unify with flex, even if the
// rigid names are the same.