summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--parsing/parser.mly2
-rw-r--r--typing/printtyp.ml10
2 files changed, 9 insertions, 3 deletions
diff --git a/parsing/parser.mly b/parsing/parser.mly
index afb9c4139..1f65d7ba6 100644
--- a/parsing/parser.mly
+++ b/parsing/parser.mly
@@ -1213,6 +1213,8 @@ simple_core_type:
{ mktyp(Ptyp_variant(List.rev $2, not $3, List.rev $5)) }
| LBRACKET RBRACKET
{ mktyp(Ptyp_variant([],true,[])) }
+ | LBRACKETLESS DOTDOT RBRACKET
+ { mktyp(Ptyp_variant([],false,[])) }
;
opt_opened:
BAR DOTDOT { true }
diff --git a/typing/printtyp.ml b/typing/printtyp.ml
index 81e3e19e1..aa8e9e799 100644
--- a/typing/printtyp.ml
+++ b/typing/printtyp.ml
@@ -285,14 +285,18 @@ let rec typexp sch prio0 ty =
if not (row.row_closed && all_present) && sch &&
px.level <> generic_level then print_string "_["
else print_char '[';
- if row.row_closed && all_present then () else
- if all_present then print_char '>' else print_char '<';
+ if all_present then begin
+ if row.row_closed then () else
+ if fields = [] then print_string "< .." else
+ print_char '>'
+ end else
+ print_char '<';
print_list (row_field sch) (fun () -> printf "@,|") fields;
if not (row.row_closed || all_present) then printf "@,| ..";
if present <> [] && not all_present then begin
print_space ();
open_hovbox 2;
- print_string "|>";
+ print_string ">";
print_list (fun (s,_) -> print_char '`'; print_string s)
print_space present;
close_box ()