Skip to content

tast_{iterator,mapper} were missing locs in jkind annotations #2023

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions ocaml/typing/tast_iterator.ml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ type iterator =
env: iterator -> Env.t -> unit;
expr: iterator -> expression -> unit;
extension_constructor: iterator -> extension_constructor -> unit;
jkind_annotation: iterator -> Jkind.const -> unit;
jkind_annotation: iterator -> Jkind.annotation -> unit;
location: iterator -> Location.t -> unit;
module_binding: iterator -> module_binding -> unit;
module_coercion: iterator -> module_coercion -> unit;
Expand Down Expand Up @@ -578,7 +578,7 @@ let typ sub {ctyp_loc; ctyp_desc; ctyp_env; ctyp_attributes; _} =
sub.env sub ctyp_env;
match ctyp_desc with
| Ttyp_var (_, jkind) ->
Option.iter (fun (jkind, _) -> sub.jkind_annotation sub jkind) jkind
Option.iter (sub.jkind_annotation sub) jkind
| Ttyp_arrow (_, ct1, ct2) ->
sub.typ sub ct1;
sub.typ sub ct2
Expand All @@ -592,10 +592,10 @@ let typ sub {ctyp_loc; ctyp_desc; ctyp_env; ctyp_attributes; _} =
List.iter (sub.typ sub) list
| Ttyp_alias (ct, _, jkind) ->
sub.typ sub ct;
Option.iter (fun (jkind, _) -> sub.jkind_annotation sub jkind) jkind
Option.iter (sub.jkind_annotation sub) jkind
| Ttyp_variant (list, _, _) -> List.iter (sub.row_field sub) list
| Ttyp_poly (vars, ct) ->
List.iter (fun (_, l) -> Option.iter (fun (j, _) -> sub.jkind_annotation sub j) l) vars;
List.iter (fun (_, l) -> Option.iter (sub.jkind_annotation sub) l) vars;
sub.typ sub ct
| Ttyp_package pack -> sub.package_type sub pack

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

let env _sub _ = ()

let jkind_annotation _sub _ = ()
let jkind_annotation sub (_, l) = iter_loc sub l

let default_iterator =
{
Expand Down
2 changes: 1 addition & 1 deletion ocaml/typing/tast_iterator.mli
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ type iterator =
env: iterator -> Env.t -> unit;
expr: iterator -> expression -> unit;
extension_constructor: iterator -> extension_constructor -> unit;
jkind_annotation: iterator -> Jkind.const -> unit;
jkind_annotation: iterator -> Jkind.annotation -> unit;
location: iterator -> Location.t -> unit;
module_binding: iterator -> module_binding -> unit;
module_coercion: iterator -> module_coercion -> unit;
Expand Down
2 changes: 1 addition & 1 deletion ocaml/typing/tast_mapper.ml
Original file line number Diff line number Diff line change
Expand Up @@ -914,7 +914,7 @@ let value_binding sub x =

let env _sub x = x

let jkind_annotation _sub l = l
let jkind_annotation sub (c, l) = (c, map_loc sub l)

let default =
{
Expand Down