mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 14:24:45 +00:00
Nested Eq constraint in Exhaustive behind SoA
This commit is contained in:
parent
17e7b10267
commit
1de67fe19a
2 changed files with 38 additions and 50 deletions
|
@ -776,7 +776,7 @@ fn solve(
|
|||
|
||||
copy
|
||||
}
|
||||
Eq(type_index, expectation_index, category_index, region) => {
|
||||
Eq(roc_can::constraint::Eq(type_index, expectation_index, category_index, region)) => {
|
||||
let category = &constraints.categories[category_index.index()];
|
||||
|
||||
let actual =
|
||||
|
@ -1197,14 +1197,7 @@ fn solve(
|
|||
}
|
||||
}
|
||||
}
|
||||
&Exhaustive {
|
||||
real_var,
|
||||
real_region,
|
||||
real_category,
|
||||
expected_branches,
|
||||
sketched_rows,
|
||||
context,
|
||||
} => {
|
||||
&Exhaustive(eq, sketched_rows, context) => {
|
||||
// A few cases:
|
||||
// 1. Either condition or branch types already have a type error. In this case just
|
||||
// propagate it.
|
||||
|
@ -1216,6 +1209,16 @@ fn solve(
|
|||
// 4. Condition and branch types aren't "almost equal", this is just a normal type
|
||||
// error.
|
||||
|
||||
let roc_can::constraint::Eq(
|
||||
real_var,
|
||||
expected_branches,
|
||||
real_category,
|
||||
real_region,
|
||||
) = constraints.eq[eq.index()];
|
||||
|
||||
let real_var =
|
||||
either_type_index_to_var(constraints, subs, rank, pools, aliases, real_var);
|
||||
|
||||
let expected_branches = &constraints.expectations[expected_branches.index()];
|
||||
let branches_var =
|
||||
type_to_var(subs, rank, pools, aliases, expected_branches.get_type_ref());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue