mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 06:14:46 +00:00
Special-case 2-branch if/else errors
This commit is contained in:
parent
dc3e2d307c
commit
98f4f46248
6 changed files with 158 additions and 75 deletions
|
@ -435,7 +435,10 @@ pub fn constrain_expr(
|
|||
loc_body.region,
|
||||
&loc_body.value,
|
||||
ForReason(
|
||||
Reason::IfBranch { index: index + 1 },
|
||||
Reason::IfBranch {
|
||||
index: index + 1,
|
||||
total_branches: branches.len(),
|
||||
},
|
||||
Type::Variable(*branch_var),
|
||||
loc_body.region,
|
||||
),
|
||||
|
@ -451,6 +454,7 @@ pub fn constrain_expr(
|
|||
ForReason(
|
||||
Reason::IfBranch {
|
||||
index: branches.len() + 1,
|
||||
total_branches: branches.len() + 1,
|
||||
},
|
||||
Type::Variable(*branch_var),
|
||||
final_else.region,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue