File tree Expand file tree Collapse file tree 2 files changed +20
-2
lines changed
testsuite/tests/tool-toplevel Expand file tree Collapse file tree 2 files changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -132,6 +132,7 @@ type 'a t += A : int t
132
132
#show Set. OrderedType ;;
133
133
[%% expect {|
134
134
module type OrderedType = Set. OrderedType
135
+ module type OrderedType = sig type t val compare : t -> t -> int end
135
136
| }];;
136
137
137
138
module U = Stdlib. Unit ;;
@@ -159,7 +160,11 @@ module U :
159
160
end
160
161
| }];;
161
162
163
+ (* Similar stuttering here now that (post-11533) module type synonyms
164
+ are also followed. *)
162
165
#show OT ;;
163
166
[%% expect {|
164
167
module type OT = Set. OrderedType
168
+ module type OT = Set. OrderedType
169
+ module type OT = sig type t val compare : t -> t -> int end
165
170
| }];;
Original file line number Diff line number Diff line change @@ -563,8 +563,21 @@ let () =
563
563
let () =
564
564
reg_show_prim " show_module_type"
565
565
(fun env loc id lid ->
566
- let _path, desc = Env. lookup_modtype ~loc lid env in
567
- [ Sig_modtype (id, desc, Exported ) ]
566
+ let path, mtd = Env. lookup_modtype ~loc lid env in
567
+ let id = match path with
568
+ | Pident id -> id
569
+ | _ -> id
570
+ in
571
+ let rec accum_defs mtd acc =
572
+ let acc = Sig_modtype (id, mtd, Exported ) :: acc in
573
+ match mtd.mtd_type with
574
+ | Some (Mty_ident path ) ->
575
+ let mtd = Env. find_modtype path env in
576
+ accum_defs mtd acc
577
+ | None | Some (Mty_alias _ | Mty_signature _ | Mty_functor _ ) ->
578
+ List. rev acc
579
+ in
580
+ accum_defs mtd []
568
581
)
569
582
" Print the signature of the corresponding module type."
570
583
You can’t perform that action at this time.
0 commit comments