jon.recoil.org

Module Ocaml_typing.Includecore

type position = Ocaml_typing.Errortrace.position =
  1. | First
  2. | Second
type primitive_mismatch =
  1. | Name
  2. | Arity
  3. | No_alloc of Ocaml_typing.Includecore.position
  4. | Builtin
  5. | Effects
  6. | Coeffects
  7. | Native_name
  8. | Result_repr
  9. | Argument_repr of int
  10. | Layout_poly_attr
type privacy_mismatch =
  1. | Private_type_abbreviation
  2. | Private_variant_type
  3. | Private_record_type
  4. | Private_record_unboxed_product_type
  5. | Private_extensible_variant
  6. | Private_row_type
type type_kind =
  1. | Kind_abstract
  2. | Kind_record
  3. | Kind_record_unboxed_product
  4. | Kind_variant
  5. | Kind_open
type record_mismatch =
  1. | Label_mismatch of Ocaml_typing.Includecore.record_change list
  2. | Inlined_representation of Ocaml_typing.Includecore.position
  3. | Float_representation of Ocaml_typing.Includecore.position
  4. | Ufloat_representation of Ocaml_typing.Includecore.position
  5. | Mixed_representation of Ocaml_typing.Includecore.position
  6. | Mixed_representation_with_flat_floats of Ocaml_typing.Includecore.position
type constructor_mismatch =
  1. | Type of Ocaml_typing.Errortrace.equality_error
  2. | Arity
  3. | Inline_record of Ocaml_typing.Includecore.record_change list
  4. | Kind of Ocaml_typing.Includecore.position
  5. | Explicit_return_type of Ocaml_typing.Includecore.position
  6. | Modality of int * Ocaml_typing.Mode.Modality.equate_error
type private_variant_mismatch =
  1. | Only_outer_closed
  2. | Missing of Ocaml_typing.Includecore.position * string
  3. | Presence of string
  4. | Incompatible_types_for of string
  5. | Types of Ocaml_typing.Errortrace.equality_error
type private_object_mismatch =
  1. | Missing of string
  2. | Types of Ocaml_typing.Errortrace.equality_error
type unsafe_mode_crossing_mismatch =
  1. | Mode_crossing_only_on of Ocaml_typing.Includecore.position
  2. | Bounds_not_equal of Ocaml_typing.Types.unsafe_mode_crossing * Ocaml_typing.Types.unsafe_mode_crossing
type mmodes =
  1. | All
    (*

    Check module inclusion M1 : MT1 @ m <= MT2 @ m for all m.

    *)
  2. | Specific of Ocaml_typing.Mode.Value.l * Ocaml_typing.Mode.Value.r * Ocaml_typing.Typedtree.held_locks option
    (*

    Check module inclusion M1 : MT1 @ m1 <= MT2 @ m2.

    No prior constraint between m1 and m2 is given. In particular, it's possible that m1 >= m2. For example, if m1 = nonportable >= portable = m2 and MT2 = sig end, the inclusion check should pass. This finer treatment is necessary for ergonomics.

    Another ergonomics is wrt closing over modules. If M1 is a Pmod_ident, all surrounding functions would naively close over M1. However, if M1 = nonportable and MT2 = sig end, surrounding functions shouldn't be forced to nonportable. To that end, the locks leading to M1 is not walked immediately upon look-up, but held and passed to inclusion check for finer treatment. This is the third constructor argument. This is similar to the ergonomics in Typecore.type_ident wrt projections out of modules.

    *)

Describes the modes of modules on both sides, passed to inclusion check.

Gives the modes suitable for the inclusion check of a child item, where there is no modality between the parent and the child. Takes the modes suitable for the parent item.

Gives the modes suitable for the inclusion check of a child item. Takes the modes suitable for the inclusion check of the parent item, and both hands' modalities between the parent and the child.

Claim the current item is included by the RHS and its mode checked.

val report_value_mismatch : string -> string -> Ocaml_typing.Env.t -> Stdlib.Format.formatter -> Ocaml_typing.Includecore.value_mismatch -> unit
val report_type_mismatch : string -> string -> string -> Ocaml_typing.Env.t -> Stdlib.Format.formatter -> Ocaml_typing.Includecore.type_mismatch -> unit
val report_modality_sub_error : string -> string -> Stdlib.Format.formatter -> Ocaml_typing.Mode.Modality.error -> unit
val report_mode_sub_error : string -> string -> Stdlib.Format.formatter -> Ocaml_typing.Mode.Value.error -> unit
val report_extension_constructor_mismatch : string -> string -> string -> Ocaml_typing.Env.t -> Stdlib.Format.formatter -> Ocaml_typing.Includecore.extension_constructor_mismatch -> unit