diff options
author | Alain Frisch <alain@frisch.fr> | 2014-10-07 07:36:21 +0000 |
---|---|---|
committer | Alain Frisch <alain@frisch.fr> | 2014-10-07 07:36:21 +0000 |
commit | e1eddd80edc9dfcf5c765e7c50e7e430d152874d (patch) | |
tree | 2f0491952c047b7980f423103cabbdcc1526358b /typing | |
parent | ad32b4dceeaf287c68d7ae1aa1742bad62cee63c (diff) |
Disallow completely inline records on GADT constructors.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record4@15481 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'typing')
-rw-r--r-- | typing/datarepr.ml | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/typing/datarepr.ml b/typing/datarepr.ml index 091fcdedb..ffce59d3c 100644 --- a/typing/datarepr.ml +++ b/typing/datarepr.ml @@ -18,7 +18,7 @@ open Types open Btype type error = - | GADT_inlined_record_arity + | GADT_inlined_record exception Error of Location.t * error @@ -66,10 +66,7 @@ let constructor_args cd_args cd_res type_params loc path type_manifest rep = let type_params = match cd_res with | None -> type_params - | Some _ -> - match TypeSet.elements arg_vars_set with - | [] | [_] as l -> l - | _ -> raise (Error (loc, GADT_inlined_record_arity)) + | Some _ -> raise (Error (loc, GADT_inlined_record)) in let type_manifest = match type_manifest with @@ -235,10 +232,9 @@ let labels_of_type ty_path decl = | Type_variant _ | Type_abstract | Type_open -> [] let report_error ppf = function - | GADT_inlined_record_arity -> + | GADT_inlined_record -> Format.fprintf ppf - "A record argument on a GADT constructor can have at most \ - one free variable." + "Record arguments are not allowed on GADT constructors." let () = Location.register_error_of_exn |