mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 13:29:12 +00:00
Pattern expectation takes a type index
This commit is contained in:
parent
cbd014a98a
commit
34cd1fb825
5 changed files with 81 additions and 81 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue