Pattern expectation takes a type index

This commit is contained in:
Ayaz Hafiz 2022-10-25 11:25:19 -05:00
parent cbd014a98a
commit 34cd1fb825
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58
5 changed files with 81 additions and 81 deletions

View file

@ -1180,15 +1180,16 @@ fn solve(
);
let expectation = &constraints.pattern_expectations[expectation_index.index()];
let expected = type_cell_to_var(
let expected = either_type_index_to_var(
constraints,
subs,
rank,
pools,
problems,
abilities_store,
obligation_cache,
pools,
aliases,
expectation.get_type_ref(),
*expectation.get_type_ref(),
);
let mode = match constraint {
@ -1495,22 +1496,10 @@ fn solve(
constraints.eq[eq.index()];
let expected = &constraints.expectations[expected.index()];
let branches_var = either_type_index_to_var(
constraints,
subs,
rank,
pools,
problems,
abilities_store,
obligation_cache,
aliases,
*expected.get_type_ref(),
);
(
real_var,
real_region,
branches_var,
*expected.get_type_ref(),
Ok((category, expected)),
)
}
@ -1523,21 +1512,10 @@ fn solve(
) = constraints.pattern_eq[peq.index()];
let expected = &constraints.pattern_expectations[expected.index()];
let branches_var = type_cell_to_var(
subs,
rank,
problems,
abilities_store,
obligation_cache,
pools,
aliases,
expected.get_type_ref(),
);
(
real_var,
real_region,
branches_var,
*expected.get_type_ref(),
Err((category, expected)),
)
}
@ -1555,15 +1533,16 @@ fn solve(
real_var,
);
let branches_var = type_cell_to_var(
let branches_var = either_type_index_to_var(
constraints,
subs,
rank,
pools,
problems,
abilities_store,
obligation_cache,
pools,
aliases,
expected_type,
branches_var,
);
let cond_source_is_likely_positive_value = category_and_expected.is_ok();