Skip to content

Commit a4aa280

Browse files
committed
Fix compilation with dune-based build
1 parent 50271c6 commit a4aa280

File tree

2 files changed

+8
-25
lines changed

2 files changed

+8
-25
lines changed

ocaml/typing/typedecl.ml

+3-3
Original file line numberDiff line numberDiff line change
@@ -642,13 +642,13 @@ let transl_declaration env sdecl (id, uid) =
642642
raise(Error(sdecl.ptype_loc, Too_many_constructors));
643643
let make_cstr scstr =
644644
let name = Ident.create_local scstr.pcd_name.txt in
645-
let (svars, attributes) : _ Either.t * _ =
645+
let svars, attributes =
646646
match Jane_syntax.Layouts.of_constructor_declaration scstr with
647647
| None ->
648-
Left scstr.pcd_vars,
648+
Either.Left scstr.pcd_vars,
649649
scstr.pcd_attributes
650650
| Some (vars_layouts, attributes) ->
651-
Right vars_layouts,
651+
Either.Right vars_layouts,
652652
attributes
653653
in
654654
let tvars, targs, tret_type, args, ret_type =

printer/printast_with_mappings.ml

+5-22
Original file line numberDiff line numberDiff line change
@@ -151,27 +151,14 @@ let arg_label i ppf = function
151151
let typevars ppf vs =
152152
List.iter (fun x -> fprintf ppf " %a" Printast.tyvar x.txt) vs
153153

154-
let layout_annotation i ppf layout =
155-
line i ppf "%s" (Layouts.Layout.string_of_const layout.txt)
156-
157-
let layout_annotation_option ppf = function
158-
| None -> fprintf ppf "--"
159-
| Some lay -> fprintf ppf "%s" (Layouts.Layout.string_of_const lay.txt)
160-
161-
let type_vars_layouts ppf vars_layouts =
162-
List.iter (fun lay -> fprintf ppf " %a" layout_annotation_option lay)
163-
vars_layouts
164-
165154
let rec core_type i ppf x =
166155
with_location_mapping ~loc:x.ptyp_loc ppf (fun () ->
167156
line i ppf "core_type %a\n" fmt_location x.ptyp_loc;
168157
attributes i ppf x.ptyp_attributes;
169158
let i = i+1 in
170159
match x.ptyp_desc with
171160
| Ptyp_any -> line i ppf "Ptyp_any\n";
172-
| Ptyp_var (s, layout) ->
173-
line i ppf "Ptyp_var %s\n" s;
174-
option i layout_annotation ppf layout
161+
| Ptyp_var (s) -> line i ppf "Ptyp_var %s\n" s;
175162
| Ptyp_arrow (l, ct1, ct2) ->
176163
line i ppf "Ptyp_arrow\n";
177164
arg_label i ppf l;
@@ -206,13 +193,12 @@ let rec core_type i ppf x =
206193
| Ptyp_alias (ct, s) ->
207194
line i ppf "Ptyp_alias \"%s\"\n" s;
208195
core_type i ppf ct;
209-
| Ptyp_poly (sl, ct, lays) ->
196+
| Ptyp_poly (sl, ct) ->
210197
line i ppf "Ptyp_poly%a\n"
211198
(fun ppf ->
212199
List.iter (fun x -> fprintf ppf " %a" Printast.tyvar x.txt)
213200
)
214201
sl;
215-
line i ppf "layouts%a\n" type_vars_layouts lays;
216202
core_type i ppf ct;
217203
| Ptyp_package (s, l) ->
218204
line i ppf "Ptyp_package %a\n" fmt_longident_loc s;
@@ -403,9 +389,8 @@ and expression i ppf x =
403389
| Pexp_object s ->
404390
line i ppf "Pexp_object\n";
405391
class_structure i ppf s
406-
| Pexp_newtype (s, e, lay) ->
392+
| Pexp_newtype (s, e) ->
407393
line i ppf "Pexp_newtype \"%s\"\n" s.txt;
408-
layout_annotation_option ppf lay;
409394
expression i ppf e
410395
| Pexp_pack me ->
411396
line i ppf "Pexp_pack\n";
@@ -520,11 +505,9 @@ and extension_constructor i ppf x =
520505

521506
and extension_constructor_kind i ppf x =
522507
match x with
523-
Pext_decl(v, a, r, l) ->
508+
Pext_decl(v, a, r) ->
524509
line i ppf "Pext_decl\n";
525-
if v <> [] then
526-
(line (i+1) ppf "vars%a\n" typevars v;
527-
line (i+1) ppf "layouts%a\n" type_vars_layouts l);
510+
if v <> [] then line (i+1) ppf "vars%a\n" typevars v;
528511
constructor_arguments (i+1) ppf a;
529512
option (i+1) core_type ppf r;
530513
| Pext_rebind li ->

0 commit comments

Comments
 (0)