File tree Expand file tree Collapse file tree 13 files changed +66
-20
lines changed
Expand file tree Collapse file tree 13 files changed +66
-20
lines changed Original file line number Diff line number Diff line change @@ -4162,10 +4162,19 @@ and fmt_module c ctx ?rec_ ?epi ?(can_sparse = false) keyword ?(eqty = "=")
41624162 let ext = attrs.attrs_extension in
41634163 let blk_t =
41644164 Option. value_map xmty ~default: empty ~f: (fun xmty ->
4165+ let break_before_ty =
4166+ match xmty.ast.pmty_desc with
4167+ (* Break functor types that use the short syntax and avoid
4168+ misaligning the parameter types. *)
4169+ | Pmty_functor (Pfunctorty_unnamed _ , _ ) -> break 1 2
4170+ | _ -> str " "
4171+ in
41654172 let blk = fmt_module_type ?rec_ c xmty in
4173+ let pro =
4174+ str " " $ str eqty $ opt blk.pro (fun pro -> break_before_ty $ pro)
4175+ in
41664176 { blk with
4167- pro=
4168- Some (str " " $ str eqty $ opt blk.pro (fun pro -> str " " $ pro))
4177+ pro= Some pro
41694178 ; psp= fmt_if (Option. is_none blk.pro) (break 1 2 ) $ blk.psp } )
41704179 in
41714180 let blk_b = Option. value_map xbody ~default: empty ~f: (fmt_module_expr c) in
Original file line number Diff line number Diff line change @@ -143,10 +143,14 @@ module M = struct
143143end
144144
145145module Simple : (Parameters with type update_result := state) -> S = M
146+ module Simple : S -> Parameters with type update_result := state = M
146147
147- module Left_variadic : (Parameters
148- with type update_result := state * left array)
148+ module Left_variadic :
149+ (Parameters with type update_result := state * left array)
149150 -> S =
150151 M
152+ module Left_variadic : S ->
153+ Parameters with type update_result := state * left array =
154+ M
151155
152156module N : S with module type T = (U -> U) = struct end
Original file line number Diff line number Diff line change @@ -143,10 +143,14 @@ module M = struct
143143end
144144
145145module Simple : (Parameters with type update_result := state) -> S = M
146+ module Simple : S -> Parameters with type update_result := state = M
146147
147- module Left_variadic : (Parameters
148- with type update_result := state * left array)
148+ module Left_variadic :
149+ (Parameters with type update_result := state * left array)
149150 -> S =
150151 M
152+ module Left_variadic : S ->
153+ Parameters with type update_result := state * left array =
154+ M
151155
152156module N : S with module type T = (U -> U) = struct end
Original file line number Diff line number Diff line change 44
55module Simple : (Parameters with type update_result := state) -> S
66
7- module Left_variadic : (Parameters
8- with type update_result := state * left array)
7+ module Left_variadic :
8+ (Parameters with type update_result := state * left array)
99 -> S
Original file line number Diff line number Diff line change @@ -123,10 +123,15 @@ module M = struct
123123end
124124
125125module Simple : (Parameters with type update_result := state) -> S = M
126+ module Simple : S -> Parameters with type update_result := state = M
126127
127- module Left_variadic : (Parameters
128- with type update_result := state * left array)
128+ module Left_variadic :
129+ (Parameters with type update_result := state * left array)
129130 -> S =
130131 M
131132
133+ module Left_variadic : S ->
134+ Parameters with type update_result := state * left array =
135+ M
136+
132137module N : S with module type T = (U -> U) = struct end
Original file line number Diff line number Diff line change @@ -123,10 +123,15 @@ module M = struct
123123end
124124
125125module Simple : (Parameters with type update_result := state) -> S = M
126+ module Simple : S -> Parameters with type update_result := state = M
126127
127- module Left_variadic : (Parameters
128- with type update_result := state * left array)
128+ module Left_variadic :
129+ (Parameters with type update_result := state * left array)
129130 -> S =
130131 M
131132
133+ module Left_variadic : S ->
134+ Parameters with type update_result := state * left array =
135+ M
136+
132137module N : S with module type T = (U -> U) = struct end
Original file line number Diff line number Diff line change 44
55module Simple : (Parameters with type update_result := state) -> S
66
7- module Left_variadic : (Parameters
8- with type update_result := state * left array)
7+ module Left_variadic :
8+ (Parameters with type update_result := state * left array)
99 -> S
Original file line number Diff line number Diff line change @@ -122,5 +122,7 @@ module M = struct
122122end
123123
124124module Simple : (Parameters with type update_result := state) -> S = M
125+ module Simple : S -> Parameters with type update_result := state = M
125126module Left_variadic : (Parameters with type update_result := state * left array) -> S = M
127+ module Left_variadic : S -> Parameters with type update_result := state * left array = M
126128module N : S with module type T = (U -> U) = struct end
Original file line number Diff line number Diff line change @@ -122,5 +122,7 @@ module M = struct
122122end
123123
124124module Simple : (Parameters with type update_result := state) -> S = M
125+ module Simple : S -> Parameters with type update_result := state = M
125126module Left_variadic : (Parameters with type update_result := state * left array) -> S = M
127+ module Left_variadic : S -> Parameters with type update_result := state * left array = M
126128module N : S with module type T = (U -> U) = struct end
Original file line number Diff line number Diff line change 159159
160160module Simple : (Parameters with type update_result := state) -> S = M
161161
162- module Left_variadic : (Parameters
163- with type update_result := state * left array)
162+ module Simple : S -> Parameters with type update_result := state = M
163+
164+ module Left_variadic :
165+ (Parameters with type update_result := state * left array)
164166 -> S =
165167 M
166168
169+ module Left_variadic : S ->
170+ Parameters with type update_result := state * left array =
171+ M
172+
167173module N : S with module type T = (U -> U) = struct end
You can’t perform that action at this time.
0 commit comments