mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-03 00:24:34 +00:00
elem_in_list
This commit is contained in:
parent
200adae507
commit
f8b3d5dce7
5 changed files with 63 additions and 8 deletions
|
@ -596,9 +596,12 @@ pub fn constrain_expr(
|
|||
let entry_type = Type::Variable(*elem_var);
|
||||
let mut constraints = Vec::with_capacity(1 + loc_elems.len());
|
||||
|
||||
for loc_elem in loc_elems.iter() {
|
||||
let elem_expected =
|
||||
Expected::ForReason(Reason::ElemInList, entry_type.clone(), region);
|
||||
for (index, loc_elem) in loc_elems.iter().enumerate() {
|
||||
let elem_expected = Expected::ForReason(
|
||||
Reason::ElemInList { index },
|
||||
entry_type.clone(),
|
||||
region,
|
||||
);
|
||||
let constraint = constrain_expr(
|
||||
env,
|
||||
var_store,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue