summaryrefslogtreecommitdiff
path: root/typing/typetexp.ml
diff options
context:
space:
mode:
Diffstat (limited to 'typing/typetexp.ml')
-rw-r--r--typing/typetexp.ml18
1 files changed, 5 insertions, 13 deletions
diff --git a/typing/typetexp.ml b/typing/typetexp.ml
index fa3f0c895a..ec2b7ed8df 100644
--- a/typing/typetexp.ml
+++ b/typing/typetexp.ml
@@ -355,12 +355,8 @@ let rec transl_type env policy styp =
row_fixed = false; row_name = !name } in
let static = Btype.static_row row in
let row =
- if static then row else
- match policy with
- Fixed ->
- raise (Error (styp.ptyp_loc, Unbound_type_variable ".."))
- | Extensible -> row
- | Univars -> { row with row_more = new_pre_univar () }
+ if static || policy <> Univars then row
+ else { row with row_more = new_pre_univar () }
in
newty (Tvariant row)
| Ptyp_poly(vars, st) ->
@@ -392,12 +388,8 @@ and transl_fields env policy =
function
[] ->
newty Tnil
- | ({pfield_desc = Pfield_var} as pf)::_ ->
- begin match policy with
- Fixed -> raise (Error (pf.pfield_loc, Unbound_type_variable ".."))
- | Extensible -> newvar ()
- | Univars -> new_pre_univar ()
- end
+ | {pfield_desc = Pfield_var}::_ ->
+ if policy = Univars then new_pre_univar () else newvar ()
| {pfield_desc = Pfield(s, e)}::l ->
let ty1 = transl_type env policy e in
let ty2 = transl_fields env policy l in
@@ -556,7 +548,7 @@ let report_error ppf = function
Printtyp.type_expr ty
| Variant_tags (lab1, lab2) ->
fprintf ppf
- "Variant tags `%s@ and `%s have same hash value.@ Change one of them."
+ "Variant tags `%s@ and `%s have the same hash value.@ Change one of them."
lab1 lab2
| Invalid_variable_name name ->
fprintf ppf "The type variable name %s is not allowed in programs" name