Skip to content

Commit

Permalink
Fix conflicts in typing/*.mli. (#175)
Browse files Browse the repository at this point in the history
  • Loading branch information
ccasin authored Oct 18, 2023
1 parent 7445248 commit 8b05a1f
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 256 deletions.
44 changes: 5 additions & 39 deletions typing/ctype.mli
Original file line number Diff line number Diff line change
Expand Up @@ -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 *)
Expand Down Expand Up @@ -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 ->
Expand Down Expand Up @@ -476,43 +463,22 @@ 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 = {
free_variable: type_expr * variable_kind;
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;
Expand Down
45 changes: 7 additions & 38 deletions typing/env.mli
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 =
Expand Down Expand Up @@ -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
Expand Down
34 changes: 3 additions & 31 deletions typing/outcometree.mli
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
73 changes: 0 additions & 73 deletions typing/shape.mli
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down
13 changes: 1 addition & 12 deletions typing/typedtree.mli
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down Expand Up @@ -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 =
Expand Down
22 changes: 1 addition & 21 deletions typing/types.mli
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 :
Expand All @@ -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 *)
Expand Down
Loading

0 comments on commit 8b05a1f

Please sign in to comment.