jon.recoil.org

Module Includecore

type position = Errortrace.position =
  1. | First
  2. | Second
type primitive_mismatch =
  1. | Name
  2. | Arity
  3. | No_alloc of Includecore.position
  4. | Builtin
  5. | Effects
  6. | Coeffects
  7. | Native_name
  8. | Result_repr
  9. | Argument_repr of int
  10. | Layout_poly_attr
type value_mismatch =
  1. | Primitive_mismatch of Includecore.primitive_mismatch
  2. | Not_a_primitive
  3. | Type of Errortrace.moregen_error
  4. | Zero_alloc of Zero_alloc.error
  5. | Modality of Mode.Modality.error
  6. | Mode of Mode.Value.error
exception Dont_match of Includecore.value_mismatch
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 label_mismatch =
  1. | Type of Errortrace.equality_error
  2. | Mutability of Includecore.position
  3. | Atomicity of Includecore.position
  4. | Modality of Mode.Modality.equate_error
type record_mismatch =
  1. | Label_mismatch of Includecore.record_change list
  2. | Inlined_representation of Includecore.position
  3. | Float_representation of Includecore.position
  4. | Ufloat_representation of Includecore.position
  5. | Mixed_representation of Includecore.position
  6. | Mixed_representation_with_flat_floats of Includecore.position
type constructor_mismatch =
  1. | Type of Errortrace.equality_error
  2. | Arity
  3. | Inline_record of Includecore.record_change list
  4. | Kind of Includecore.position
  5. | Explicit_return_type of Includecore.position
  6. | Modality of int * Mode.Modality.equate_error
type extension_constructor_mismatch =
  1. | Constructor_privacy
  2. | Constructor_mismatch of Ident.t * Types.extension_constructor * Types.extension_constructor * Includecore.constructor_mismatch
type private_variant_mismatch =
  1. | Only_outer_closed
  2. | Missing of Includecore.position * string
  3. | Presence of string
  4. | Incompatible_types_for of string
  5. | Types of Errortrace.equality_error
type private_object_mismatch =
  1. | Missing of string
  2. | Types of Errortrace.equality_error
type unsafe_mode_crossing_mismatch =
  1. | Mode_crossing_only_on of Includecore.position
  2. | Bounds_not_equal of Types.unsafe_mode_crossing * Types.unsafe_mode_crossing
type type_mismatch =
  1. | Arity
  2. | Privacy of Includecore.privacy_mismatch
  3. | Kind of Includecore.kind_mismatch
  4. | Constraint of Errortrace.equality_error
  5. | Manifest of Errortrace.equality_error
  6. | Parameter_jkind of Types.type_expr * Jkind.Violation.t
  7. | Private_variant of Types.type_expr * Types.type_expr * Includecore.private_variant_mismatch
  8. | Private_object of Types.type_expr * Types.type_expr * Includecore.private_object_mismatch
  9. | Variance
  10. | Record_mismatch of Includecore.record_mismatch
  11. | Variant_mismatch of Includecore.variant_change list
  12. | Unboxed_representation of Includecore.position * Typedtree.attributes
  13. | Extensible_representation of Includecore.position
  14. | With_null_representation of Includecore.position
  15. | Jkind of Jkind.Violation.t
  16. | Unsafe_mode_crossing of Includecore.unsafe_mode_crossing_mismatch
type mmodes =
  1. | All
    (*

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

    *)
  2. | Specific of Mode.Value.l * Mode.Value.r * 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.

val child_modes : string -> Includecore.mmodes -> Includecore.mmodes

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.

val child_modes_with_modalities : string -> modalities:(Mode.Modality.t * Mode.Modality.t) -> Includecore.mmodes -> (Includecore.mmodes, Mode.Modality.error) Stdlib.Result.t

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 type_declarations : ?equality:bool -> loc:Location.t -> Env.t -> mark:bool -> string -> Types.type_declaration -> Path.t -> Types.type_declaration -> Includecore.type_mismatch option
val report_value_mismatch : string -> string -> Env.t -> Stdlib.Format.formatter -> Includecore.value_mismatch -> unit
val report_type_mismatch : string -> string -> string -> Env.t -> Stdlib.Format.formatter -> Includecore.type_mismatch -> unit
val report_modality_sub_error : string -> string -> Stdlib.Format.formatter -> Mode.Modality.error -> unit
val report_mode_sub_error : string -> string -> Stdlib.Format.formatter -> Mode.Value.error -> unit
val report_extension_constructor_mismatch : string -> string -> string -> Env.t -> Stdlib.Format.formatter -> Includecore.extension_constructor_mismatch -> unit