@@ -1597,7 +1597,8 @@ let split_cases env cases =
1597
1597
so [enter_variable] can be called, depending on the usage. *)
1598
1598
let type_for_loop_like_index ~error ~loc ~env ~param ~any ~var =
1599
1599
match param.ppat_desc with
1600
- | Ppat_any -> any (Ident. create_local " _for" )
1600
+ | Ppat_any ->
1601
+ any (Ident. create_local " _for" , Uid. mk ~current_unit: (Env. get_unit_name () ))
1601
1602
| Ppat_var name ->
1602
1603
var ~name
1603
1604
~pv_mode: Value. min_mode
@@ -1630,7 +1631,7 @@ let type_for_loop_index ~loc ~env ~param =
1630
1631
let pv =
1631
1632
{ pv_id; pv_uid; pv_mode; pv_type; pv_loc; pv_as_var; pv_attributes }
1632
1633
in
1633
- pv_id, add_pattern_variables ~check ~check_as: check env [pv])
1634
+ ( pv_id, pv_uid) , add_pattern_variables ~check ~check_as: check env [pv])
1634
1635
1635
1636
let type_comprehension_for_range_iterator_index ~loc ~env ~param tps =
1636
1637
type_for_loop_like_index
@@ -1643,16 +1644,14 @@ let type_comprehension_for_range_iterator_index ~loc ~env ~param tps =
1643
1644
for duplicates or anything else. *)
1644
1645
~any: Fun. id
1645
1646
~var: (fun ~name ~pv_mode ~pv_type ~pv_loc ~pv_as_var ~pv_attributes ->
1646
- (* CR tnowak: verify this change *)
1647
- fst (
1648
- enter_variable
1649
- ~is_as_variable: pv_as_var
1650
- tps
1651
- pv_loc
1652
- name
1653
- pv_mode
1654
- pv_type
1655
- pv_attributes))
1647
+ enter_variable
1648
+ ~is_as_variable: pv_as_var
1649
+ tps
1650
+ pv_loc
1651
+ name
1652
+ pv_mode
1653
+ pv_type
1654
+ pv_attributes)
1656
1655
1657
1656
1658
1657
(* Type paths *)
@@ -5347,7 +5346,8 @@ and type_expect_
5347
5346
(mk_expected ~explanation: For_loop_stop_index Predef. type_int)
5348
5347
in
5349
5348
let env = Env. add_share_lock For_loop env in
5350
- let for_id, new_env =
5349
+ (* When we'll want to add Uid to for loops, we can take it from here. *)
5350
+ let (for_id, _for_uid), new_env =
5351
5351
type_for_loop_index ~loc ~env ~param
5352
5352
in
5353
5353
let new_env = Env. add_region_lock new_env in
@@ -8115,7 +8115,9 @@ and type_comprehension_iterator
8115
8115
in
8116
8116
let start = tbound ~explanation: Comprehension_for_start start in
8117
8117
let stop = tbound ~explanation: Comprehension_for_stop stop in
8118
- let ident =
8118
+ (* When we'll want to add Uid to comprehension bindings,
8119
+ we can take it from here. *)
8120
+ let (ident, _uid) =
8119
8121
type_comprehension_for_range_iterator_index
8120
8122
tps
8121
8123
~loc
0 commit comments