diff --git a/typing/ctype.mli b/typing/ctype.mli index 800145dade..541bfc2d0f 100644 --- a/typing/ctype.mli +++ b/typing/ctype.mli @@ -139,12 +139,8 @@ val lower_contravariant: Env.t -> type_expr -> unit to be used before generalize for expansive expressions *) val lower_variables_only: Env.t -> int -> type_expr -> unit (* Lower all variables to the given level *) -<<<<<<< HEAD -||||||| merged common ancestors -======= val enforce_current_level: Env.t -> type_expr -> unit (* Lower whole type to !current_level *) ->>>>>>> ocaml/5.1 val generalize_structure: type_expr -> unit (* Generalize the structure of a type, lowering variables to !current_level *) @@ -182,23 +178,14 @@ val new_local_type: ?loc:Location.t -> ?manifest_and_scope:(type_expr * int) -> Jkind.t -> type_declaration val existential_name: constructor_description -> type_expr -> string -<<<<<<< HEAD -val instance_constructor: - ?in_pattern:Env.t ref * int -> - constructor_description -> (type_expr * global_flag) list * type_expr * type_expr list -||||||| merged common ancestors -val instance_constructor: - ?in_pattern:Env.t ref * int -> - constructor_description -> type_expr list * type_expr * type_expr list -======= type existential_treatment = | Keep_existentials_flexible | Make_existentials_abstract of { env: Env.t ref; scope: int } val instance_constructor: existential_treatment -> - constructor_description -> type_expr list * type_expr * type_expr list ->>>>>>> ocaml/5.1 + constructor_description -> + (type_expr * global_flag) list * type_expr * type_expr list (* Same, for a constructor. Also returns existentials. *) val instance_parameterized_type: ?keep_names:bool -> @@ -476,35 +463,15 @@ val nondep_cltype_declaration: val is_contractive: Env.t -> Path.t -> bool val normalize_type: type_expr -> unit -<<<<<<< HEAD val remove_mode_and_jkind_variables: type_expr -> unit (* Ensure mode and jkind variables are fully determined *) -val nongen_schema: Env.t -> type_expr -> bool - (* Check whether the given type scheme contains no non-generic - type variables, and ensure mode variables are fully determined *) -||||||| merged common ancestors -val nongen_schema: Env.t -> type_expr -> bool - (* Check whether the given type scheme contains no non-generic - type variables *) -======= val nongen_vars_in_schema: Env.t -> type_expr -> Btype.TypeSet.t option (* Return any non-generic variables in the type scheme *) ->>>>>>> ocaml/5.1 - -<<<<<<< HEAD -val nongen_class_declaration: class_declaration -> bool - (* Check whether the given class type contains no non-generic - type variables, and ensures mode variables are fully determined. - Uses the empty environment. *) -||||||| merged common ancestors -val nongen_class_declaration: class_declaration -> bool - (* Check whether the given class type contains no non-generic - type variables. Uses the empty environment. *) -======= + val nongen_vars_in_class_declaration:class_declaration -> Btype.TypeSet.t option - (* Return any non-generic variables in the class type. - Uses the empty environment. *) + (* Return any non-generic variables in the class type. Also ensures + mode variables are fully determined. Uses the empty environment. *) type variable_kind = Row_variable | Type_variable type closed_class_failure = { @@ -512,7 +479,6 @@ type closed_class_failure = { meth: string; meth_ty: type_expr; } ->>>>>>> ocaml/5.1 val free_variables: ?env:Env.t -> type_expr -> type_expr list (* If env present, then check for incomplete definitions too; diff --git a/typing/env.mli b/typing/env.mli index c65d6a3174..a2229374e2 100644 --- a/typing/env.mli +++ b/typing/env.mli @@ -18,17 +18,10 @@ open Types open Misc -<<<<<<< HEAD val register_uid : Uid.t -> loc:Location.t -> attributes:Parsetree.attribute list -> unit val get_uid_to_loc_tbl : unit -> Location.t Types.Uid.Tbl.t val get_uid_to_attributes_tbl : unit -> Parsetree.attribute list Types.Uid.Tbl.t -||||||| merged common ancestors -======= -val register_uid : Uid.t -> Location.t -> unit - -val get_uid_to_loc_tbl : unit -> Location.t Types.Uid.Tbl.t ->>>>>>> ocaml/5.1 type value_unbound_reason = | Val_unbound_instance_variable @@ -66,22 +59,13 @@ type address = type t val empty: t -<<<<<<< HEAD - -(* These environments are lazy so that they may depend on the enabled - extensions, typically adjusted via command line flags. If extensions are - changed after these environments are forced, they may be inaccurate. This - could happen, for example, if extensions are adjusted via the - compiler-libs. *) -val initial_safe_string: t Lazy.t -val initial_unsafe_string: t Lazy.t - -||||||| merged common ancestors -val initial_safe_string: t -val initial_unsafe_string: t -======= -val initial: t ->>>>>>> ocaml/5.1 + +(* This environment is lazy so that it may depend on the enabled extensions, + typically adjusted via command line flags. If extensions are changed after + theis environment is forced, they may be inaccurate. This could happen, for + example, if extensions are adjusted via the compiler-libs. *) +val initial: t Lazy.t + val diff: t -> t -> Ident.t list type type_descr_kind = @@ -374,26 +358,11 @@ val add_extension: val add_module: ?arg:bool -> ?shape:Shape.t -> Ident.t -> module_presence -> module_type -> t -> t val add_module_lazy: update_summary:bool -> -<<<<<<< HEAD Ident.t -> module_presence -> Subst.Lazy.module_type -> t -> t val add_module_declaration: ?arg:bool -> ?shape:Shape.t -> check:bool -> Ident.t -> module_presence -> module_declaration -> t -> t val add_module_declaration_lazy: ?arg:bool -> update_summary:bool -> Ident.t -> module_presence -> Subst.Lazy.module_declaration -> t -> t -||||||| merged common ancestors -val add_module: - ?arg:bool -> Ident.t -> module_presence -> module_type -> t -> t -val add_module_declaration: ?arg:bool -> check:bool -> Ident.t -> - module_presence -> module_declaration -> t -> t -val add_module_declaration_lazy: update_summary:bool -> - Ident.t -> module_presence -> Subst.Lazy.module_decl -> t -> t -======= - Ident.t -> module_presence -> Subst.Lazy.modtype -> t -> t -val add_module_declaration: ?arg:bool -> ?shape:Shape.t -> check:bool -> - Ident.t -> module_presence -> module_declaration -> t -> t -val add_module_declaration_lazy: update_summary:bool -> - Ident.t -> module_presence -> Subst.Lazy.module_decl -> t -> t ->>>>>>> ocaml/5.1 val add_modtype: Ident.t -> modtype_declaration -> t -> t val add_modtype_lazy: update_summary:bool -> Ident.t -> Subst.Lazy.modtype_declaration -> t -> t diff --git a/typing/outcometree.mli b/typing/outcometree.mli index e44d414644..efc5dc61b2 100644 --- a/typing/outcometree.mli +++ b/typing/outcometree.mli @@ -81,47 +81,19 @@ type out_vars_jkinds = (string * out_jkind option) list type out_type = | Otyp_abstract | Otyp_open -<<<<<<< HEAD - | Otyp_alias of out_type * string - | Otyp_arrow of string * out_alloc_mode * out_type * out_alloc_mode * out_type - | Otyp_class of bool * out_ident * out_type list -||||||| merged common ancestors - | Otyp_alias of out_type * string - | Otyp_arrow of string * out_type * out_type - | Otyp_class of bool * out_ident * out_type list -======= | Otyp_alias of {non_gen:bool; aliased:out_type; alias:string} - | Otyp_arrow of string * out_type * out_type + | Otyp_arrow of string * out_alloc_mode * out_type * out_alloc_mode * out_type | Otyp_class of out_ident * out_type list ->>>>>>> ocaml/5.1 | Otyp_constr of out_ident * out_type list | Otyp_manifest of out_type * out_type -<<<<<<< HEAD - | Otyp_object of (string * out_type) list * bool option - | Otyp_record of (string * out_mutable_or_global * out_type) list -||||||| merged common ancestors - | Otyp_object of (string * out_type) list * bool option - | Otyp_record of (string * bool * out_type) list -======= | Otyp_object of { fields: (string * out_type) list; open_row:bool} - | Otyp_record of (string * bool * out_type) list ->>>>>>> ocaml/5.1 + | Otyp_record of (string * out_mutable_or_global * out_type) list | Otyp_stuff of string | Otyp_sum of out_constructor list | Otyp_tuple of out_type list | Otyp_var of bool * string -<<<<<<< HEAD - | Otyp_variant of - bool * out_variant * bool * (string list) option - | Otyp_poly of out_vars_jkinds * out_type -||||||| merged common ancestors - | Otyp_variant of - bool * out_variant * bool * (string list) option - | Otyp_poly of string list * out_type -======= | Otyp_variant of out_variant * bool * (string list) option - | Otyp_poly of string list * out_type ->>>>>>> ocaml/5.1 + | Otyp_poly of out_vars_jkinds * out_type | Otyp_module of out_ident * (string * out_type) list | Otyp_attribute of out_type * out_attribute | Otyp_jkind_annot of out_type * out_jkind diff --git a/typing/shape.mli b/typing/shape.mli index 7dcb29d3ca..e1dc6bed33 100644 --- a/typing/shape.mli +++ b/typing/shape.mli @@ -22,7 +22,6 @@ module Uid : sig val reinit : unit -> unit -<<<<<<< HEAD val mk : current_unit:Compilation_unit.t option -> t val of_compilation_unit_id : Compilation_unit.t -> t val of_predef_id : Ident.t -> t @@ -93,78 +92,6 @@ val leaf : Uid.t -> t val decompose_abs : t -> (var * t) option (* CR lmaurer: Should really take a [Compilation_unit.t] *) -||||||| merged common ancestors -======= - val mk : current_unit:string -> t - val of_compilation_unit_id : Ident.t -> t - val of_predef_id : Ident.t -> t - val internal_not_actually_unique : t - - val for_actual_declaration : t -> bool - - include Identifiable.S with type t := t -end - -module Sig_component_kind : sig - type t = - | Value - | Type - | Module - | Module_type - | Extension_constructor - | Class - | Class_type - - val to_string : t -> string - - (** Whether the name of a component of that kind can appear in a type. *) - val can_appear_in_types : t -> bool -end - -module Item : sig - type t - - val make : string -> Sig_component_kind.t -> t - - val value : Ident.t -> t - val type_ : Ident.t -> t - val module_ : Ident.t -> t - val module_type : Ident.t -> t - val extension_constructor : Ident.t -> t - val class_ : Ident.t -> t - val class_type : Ident.t -> t - - module Map : Map.S with type key = t -end - -type var = Ident.t -type t = { uid: Uid.t option; desc: desc } -and desc = - | Var of var - | Abs of var * t - | App of t * t - | Struct of t Item.Map.t - | Leaf - | Proj of t * Item.t - | Comp_unit of string - -val print : Format.formatter -> t -> unit - -(* Smart constructors *) - -val for_unnamed_functor_param : var -val fresh_var : ?name:string -> Uid.t -> var * t - -val var : Uid.t -> Ident.t -> t -val abs : ?uid:Uid.t -> var -> t -> t -val app : ?uid:Uid.t -> t -> arg:t -> t -val str : ?uid:Uid.t -> t Item.Map.t -> t -val proj : ?uid:Uid.t -> t -> Item.t -> t -val leaf : Uid.t -> t - -val decompose_abs : t -> (var * t) option - ->>>>>>> ocaml/5.1 val for_persistent_unit : string -> t val leaf_for_unpack : t diff --git a/typing/typedtree.mli b/typing/typedtree.mli index f0be833ff1..74932b0a5f 100644 --- a/typing/typedtree.mli +++ b/typing/typedtree.mli @@ -84,12 +84,7 @@ and pat_extra = (** (module P) { pat_desc = Tpat_var "P" ; pat_extra = (Tpat_unpack, _, _) :: ... } (module _) { pat_desc = Tpat_any -<<<<<<< HEAD - ; pat_extra = (Tpat_unpack, _, _) :: ... } -||||||| merged common ancestors -======= ; pat_extra = (Tpat_unpack, _, _) :: ... } ->>>>>>> ocaml/5.1 *) and 'k pattern_desc = @@ -426,13 +421,7 @@ and 'k case = } and record_label_definition = -<<<<<<< HEAD - | Kept of Types.type_expr * unique_use -||||||| merged common ancestors - | Kept of Types.type_expr -======= - | Kept of Types.type_expr * mutable_flag ->>>>>>> ocaml/5.1 + | Kept of Types.type_expr * mutable_flag * unique_use | Overridden of Longident.t loc * expression and binding_op = diff --git a/typing/types.mli b/typing/types.mli index 55e06fe554..8106564f3a 100644 --- a/typing/types.mli +++ b/typing/types.mli @@ -505,26 +505,9 @@ and ('lbl, 'cstr) type_kind = | Type_variant of 'cstr list * variant_representation | Type_open -<<<<<<< HEAD (* CR layouts: after removing the void translation from lambda, we could get rid of this src_index / runtime_tag distinction. But I am leaving it in because it may not be long before we need it again. -||||||| merged common ancestors -and record_representation = - Record_regular (* All fields are boxed / tagged *) - | Record_float (* All fields are floats *) - | Record_unboxed of bool (* Unboxed single-field record, inlined or not *) - | Record_inlined of int (* Inlined record *) - | Record_extension of Path.t (* Inlined record under extension *) -======= -and record_representation = - Record_regular (* All fields are boxed / tagged *) - | Record_float (* All fields are floats *) - | Record_unboxed of bool (* Unboxed single-field record, inlined or not *) - | Record_inlined of int (* Inlined record *) - | Record_extension of Path.t (* Inlined record under extension *) - (* The argument is the path of the extension *) ->>>>>>> ocaml/5.1 In particular, lambda will need to do something about computing offsets for block projections when not everything is one word wide, whether that's @@ -739,7 +722,6 @@ module Map_wrapped(From : Wrapped)(To : Wrapped) : sig map_type_expr: mapper -> type_expr From.wrapped -> type_expr To.wrapped } -<<<<<<< HEAD val value_description : mapper -> From.value_description -> To.value_description val module_declaration : @@ -754,10 +736,8 @@ module Map_wrapped(From : Wrapped)(To : Wrapped) : sig end include Wrapped with type 'a wrapped = 'a -||||||| merged common ancestors -======= + val item_visibility : signature_item -> visibility ->>>>>>> ocaml/5.1 (* Constructor and record label descriptions inserted held in typing environments *) diff --git a/typing/typetexp.mli b/typing/typetexp.mli index 0d5aa864b8..878b15b9fe 100644 --- a/typing/typetexp.mli +++ b/typing/typetexp.mli @@ -50,47 +50,13 @@ module TyVarEnv : sig Env.t -> Location.t -> poly_univars -> type_expr list (** Same as [check_poly_univars], but instantiates the resulting type scheme (i.e. variables become Tvar rather than Tunivar) *) -end - -module TyVarEnv : sig - (* this is just the subset of [TyVarEnv] that is needed outside - of [Typetexp]. See the ml file for more. *) - - val reset : unit -> unit - (** removes all type variables from scope *) - - val with_local_scope : (unit -> 'a) -> 'a - (** Evaluate in a narrowed type-variable scope *) - - type poly_univars - val make_poly_univars : string list -> poly_univars - (** remember that a list of strings connotes univars; this must - always be paired with a [check_poly_univars]. *) - - val check_poly_univars : - Env.t -> Location.t -> poly_univars -> type_expr list - (** Verify that the given univars are universally quantified, - and return the list of variables. The type in which the - univars are used must be generalised *) - - val instance_poly_univars : - Env.t -> Location.t -> poly_univars -> type_expr list - (** Same as [check_poly_univars], but instantiates the resulting - type scheme (i.e. variables become Tvar rather than Tunivar) *) end val valid_tyvar_name : string -> bool val transl_simple_type: -<<<<<<< HEAD Env.t -> ?univars:TyVarEnv.poly_univars -> closed:bool -> Alloc.Const.t -||||||| merged common ancestors - Env.t -> ?univars:poly_univars -> bool -> Parsetree.core_type - -> Typedtree.core_type -======= - Env.t -> ?univars:TyVarEnv.poly_univars -> closed:bool ->>>>>>> ocaml/5.1 -> Parsetree.core_type -> Typedtree.core_type val transl_simple_type_univars: Env.t -> Parsetree.core_type -> Typedtree.core_type @@ -108,19 +74,11 @@ val transl_type_param: (* the Path.t above is of the type/class whose param we are processing; the level defaults to the current level *) -<<<<<<< HEAD val get_type_param_jkind: Path.t -> Parsetree.core_type -> jkind val get_type_param_name: Parsetree.core_type -> string option val get_alloc_mode : Parsetree.core_type -> Alloc.Const.t -||||||| merged common ancestors -type variable_context -val narrow: unit -> variable_context -val widen: variable_context -> unit - -======= ->>>>>>> ocaml/5.1 exception Already_bound type value_loc =