mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-24 12:32:29 +00:00
Rename variables
This commit is contained in:
parent
83e35fa40d
commit
91eb9aaea4
1 changed files with 9 additions and 8 deletions
|
@ -1966,16 +1966,17 @@ fn constrain_when_branch_help(
|
||||||
state.headers.extend(partial_state.headers);
|
state.headers.extend(partial_state.headers);
|
||||||
} else {
|
} else {
|
||||||
// Make sure the bound variables in the patterns on the same branch agree in their types.
|
// Make sure the bound variables in the patterns on the same branch agree in their types.
|
||||||
for (sym, typ1) in state.headers.iter() {
|
for (sym, all_branches_bound_typ) in state.headers.iter() {
|
||||||
if let Some(typ2) = partial_state.headers.get(sym) {
|
if let Some(this_bound_typ) = partial_state.headers.get(sym) {
|
||||||
let type_index = constraints.push_type(typ1.value.clone());
|
let whole_typ = constraints.push_type(all_branches_bound_typ.value.clone());
|
||||||
let expected_index =
|
let this_typ = constraints
|
||||||
constraints.push_expected_type(Expected::NoExpectation(typ2.value.clone()));
|
.push_expected_type(Expected::NoExpectation(this_bound_typ.value.clone()));
|
||||||
|
|
||||||
state.constraints.push(constraints.equal_types(
|
state.constraints.push(constraints.equal_types(
|
||||||
type_index,
|
whole_typ,
|
||||||
expected_index,
|
this_typ,
|
||||||
Category::When,
|
Category::When,
|
||||||
typ2.region,
|
this_bound_typ.region,
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue