@@ -243,20 +243,23 @@ val filter_arrow_n :
243243
244244val filter_method : Env .t -> string -> type_expr -> type_expr
245245(* * Constrain a type to have the named readable object field and return the
246- field's stored type. A missing field extends an open row as [Immutable].
247- A closed row without the field, or a non-object type which cannot be
248- constrained to an object, raises [Unify]. *)
246+ field's stored type. If lookup reaches a [Tvar] row terminator, a missing
247+ field extends that inferred row as [Immutable]. A row ending in [Tunivar],
248+ [Tconstr], or [Tnil] cannot acquire a missing field. A non-object type which
249+ cannot be constrained to an object also raises [Unify]. *)
249250
250251type object_field_write_error = Owrite_missing | Owrite_not_mutable
251252
252253val filter_object_field_for_write :
253254 Env .t -> string -> type_expr -> (type_expr , object_field_write_error ) Result .t
254255(* * Constrain a type for assignment to the named object field.
255256
256- A mutable field returns its stored type. On an open row, an immutable field
257- is promoted without changing its type, and a missing field is added as
258- mutable. On a closed row, these cases return [Owrite_not_mutable] and
259- [Owrite_missing], respectively. *)
257+ A mutable field returns its stored type. When the object row ends in a
258+ [Tvar], an immutable field is promoted without changing its type, and a
259+ missing field is added as mutable. [Tunivar] and private-row [Tconstr]
260+ terminators are structurally open but cannot be strengthened. With either
261+ of those terminators, or with [Tnil], an immutable field returns
262+ [Owrite_not_mutable] and a missing field returns [Owrite_missing]. *)
260263
261264val occur_in : Env .t -> type_expr -> type_expr -> bool
262265val deep_occur : type_expr -> type_expr -> bool
0 commit comments