mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 06:14:46 +00:00
Fix failing reporting tests
This commit is contained in:
parent
aa50b141f7
commit
c01baa9168
3 changed files with 81 additions and 18 deletions
|
@ -606,6 +606,15 @@ pub fn constrain_expr(
|
|||
)
|
||||
};
|
||||
|
||||
let branches_region = {
|
||||
debug_assert!(!branches.is_empty());
|
||||
Region::span_across(
|
||||
&loc_cond.region,
|
||||
// &branches.first().unwrap().region(),
|
||||
&branches.last().unwrap().region(),
|
||||
)
|
||||
};
|
||||
|
||||
let branch_expr_reason =
|
||||
|expected: &Expected<Type>, index, branch_region| match expected {
|
||||
FromAnnotation(name, arity, ann_source, _typ) => {
|
||||
|
@ -669,6 +678,17 @@ pub fn constrain_expr(
|
|||
)
|
||||
};
|
||||
|
||||
let expected_pattern = |sub_pattern| {
|
||||
PExpected::ForReason(
|
||||
PReason::WhenMatch {
|
||||
index: HumanIndex::zero_based(index),
|
||||
sub_pattern,
|
||||
},
|
||||
cond_type.clone(),
|
||||
pattern_region,
|
||||
)
|
||||
};
|
||||
|
||||
let (new_pattern_vars, new_pattern_headers, pattern_con, branch_con) =
|
||||
constrain_when_branch_help(
|
||||
constraints,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue