Skip to content

Commit

Permalink
fix Tast_mapper and Tast_iterator
Browse files Browse the repository at this point in the history
  • Loading branch information
garrigue committed Feb 3, 2021
1 parent d2e50fa commit aa12a07
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 3 additions & 1 deletion typing/tast_iterator.ml
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,9 @@ let pat
| Tpat_var _ -> ()
| Tpat_constant _ -> ()
| Tpat_tuple l -> List.iter (sub.pat sub) l
| Tpat_construct (_, _, l, _) -> List.iter (sub.pat sub) l
| Tpat_construct (_, _, l, vto) ->
List.iter (sub.pat sub) l;
Option.iter (fun (_ids, ct) -> sub.typ sub ct) vto
| Tpat_variant (_, po, _) -> Option.iter (sub.pat sub) po
| Tpat_record (l, _) -> List.iter (fun (_, _, i) -> sub.pat sub i) l
| Tpat_array l -> List.iter (sub.pat sub) l
Expand Down
5 changes: 3 additions & 2 deletions typing/tast_mapper.ml
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,9 @@ let pat
| Tpat_var _
| Tpat_constant _ -> x.pat_desc
| Tpat_tuple l -> Tpat_tuple (List.map (sub.pat sub) l)
| Tpat_construct (loc, cd, l, vl) ->
Tpat_construct (loc, cd, List.map (sub.pat sub) l, vl)
| Tpat_construct (loc, cd, l, vto) ->
let vto = Option.map (fun (vl,cty) -> vl, sub.typ sub cty) vto in
Tpat_construct (loc, cd, List.map (sub.pat sub) l, vto)
| Tpat_variant (l, po, rd) ->
Tpat_variant (l, Option.map (sub.pat sub) po, rd)
| Tpat_record (l, closed) ->
Expand Down

0 comments on commit aa12a07

Please sign in to comment.