Skip to content

Commit b13c746

Browse files
authored
flambda-backend: tast_{iterator,mapper} were missing locs in jkind annotations (#2023)
tast_{iterator,mapper} were missing locs in jkind annotations
1 parent 95bb02c commit b13c746

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

typing/tast_iterator.ml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ type iterator =
3434
env: iterator -> Env.t -> unit;
3535
expr: iterator -> expression -> unit;
3636
extension_constructor: iterator -> extension_constructor -> unit;
37-
jkind_annotation: iterator -> Jkind.const -> unit;
37+
jkind_annotation: iterator -> Jkind.annotation -> unit;
3838
location: iterator -> Location.t -> unit;
3939
module_binding: iterator -> module_binding -> unit;
4040
module_coercion: iterator -> module_coercion -> unit;
@@ -578,7 +578,7 @@ let typ sub {ctyp_loc; ctyp_desc; ctyp_env; ctyp_attributes; _} =
578578
sub.env sub ctyp_env;
579579
match ctyp_desc with
580580
| Ttyp_var (_, jkind) ->
581-
Option.iter (fun (jkind, _) -> sub.jkind_annotation sub jkind) jkind
581+
Option.iter (sub.jkind_annotation sub) jkind
582582
| Ttyp_arrow (_, ct1, ct2) ->
583583
sub.typ sub ct1;
584584
sub.typ sub ct2
@@ -592,10 +592,10 @@ let typ sub {ctyp_loc; ctyp_desc; ctyp_env; ctyp_attributes; _} =
592592
List.iter (sub.typ sub) list
593593
| Ttyp_alias (ct, _, jkind) ->
594594
sub.typ sub ct;
595-
Option.iter (fun (jkind, _) -> sub.jkind_annotation sub jkind) jkind
595+
Option.iter (sub.jkind_annotation sub) jkind
596596
| Ttyp_variant (list, _, _) -> List.iter (sub.row_field sub) list
597597
| Ttyp_poly (vars, ct) ->
598-
List.iter (fun (_, l) -> Option.iter (fun (j, _) -> sub.jkind_annotation sub j) l) vars;
598+
List.iter (fun (_, l) -> Option.iter (sub.jkind_annotation sub) l) vars;
599599
sub.typ sub ct
600600
| Ttyp_package pack -> sub.package_type sub pack
601601

@@ -649,7 +649,7 @@ let value_binding sub {vb_loc; vb_pat; vb_expr; vb_attributes; _} =
649649

650650
let env _sub _ = ()
651651

652-
let jkind_annotation _sub _ = ()
652+
let jkind_annotation sub (_, l) = iter_loc sub l
653653

654654
let default_iterator =
655655
{

typing/tast_iterator.mli

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ type iterator =
3838
env: iterator -> Env.t -> unit;
3939
expr: iterator -> expression -> unit;
4040
extension_constructor: iterator -> extension_constructor -> unit;
41-
jkind_annotation: iterator -> Jkind.const -> unit;
41+
jkind_annotation: iterator -> Jkind.annotation -> unit;
4242
location: iterator -> Location.t -> unit;
4343
module_binding: iterator -> module_binding -> unit;
4444
module_coercion: iterator -> module_coercion -> unit;

typing/tast_mapper.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -914,7 +914,7 @@ let value_binding sub x =
914914

915915
let env _sub x = x
916916

917-
let jkind_annotation _sub l = l
917+
let jkind_annotation sub (c, l) = (c, map_loc sub l)
918918

919919
let default =
920920
{

0 commit comments

Comments
 (0)