Module Typeclass

type 'a class_info = {
  1. cls_id : Ident.t;
  2. cls_id_loc : string Asttypes.loc;
  3. cls_decl : Types.class_declaration;
  4. cls_ty_id : Ident.t;
  5. cls_ty_decl : Types.class_type_declaration;
  6. cls_obj_id : Ident.t;
  7. cls_obj_abbr : Types.type_declaration;
  8. cls_abbr : Types.type_declaration;
  9. cls_arity : int;
  10. cls_pub_methods : string list;
  11. cls_info : 'a;
}
type class_type_info = {
  1. clsty_ty_id : Ident.t;
  2. clsty_id_loc : string Asttypes.loc;
  3. clsty_ty_decl : Types.class_type_declaration;
  4. clsty_obj_id : Ident.t;
  5. clsty_obj_abbr : Types.type_declaration;
  6. clsty_abbr : Types.type_declaration;
  7. clsty_info : Typedtree.class_type_declaration;
}
val class_type_declarations : Env.t -> Parsetree.class_description list -> class_type_info list * Env.t
val approx_class_declarations : Env.t -> Parsetree.class_description list -> class_type_info list * Env.t
type kind =
  1. | Object
  2. | Class
  3. | Class_type
type error =
  1. | Unconsistent_constraint of Errortrace.unification_error
  2. | Field_type_mismatch of string * string * Errortrace.unification_error
  3. | Unexpected_field of Types.type_expr * string
  4. | Structure_expected of Types.class_type
  5. | Cannot_apply of Types.class_type
  6. | Apply_wrong_label of Asttypes.arg_label
  7. | Pattern_type_clash of Types.type_expr
  8. | Repeated_parameter
  9. | Unbound_class_2 of Longident.t
  10. | Unbound_class_type_2 of Longident.t
  11. | Abbrev_type_clash of Types.type_expr * Types.type_expr * Types.type_expr
  12. | Constructor_type_mismatch of string * Errortrace.unification_error
  13. | Virtual_class of kind * string list * string list
  14. | Undeclared_methods of kind * string list
  15. | Parameter_arity_mismatch of Longident.t * int * int
  16. | Parameter_mismatch of Errortrace.unification_error
  17. | Bad_parameters of Ident.t * Types.type_expr list * Types.type_expr list
  18. | Bad_class_type_parameters of Ident.t * Types.type_expr list * Types.type_expr list
  19. | Class_match_failure of Ctype.class_match_failure list
  20. | Unbound_val of string
  21. | Unbound_type_var of Stdlib.Format.formatter -> unit * Ctype.closed_class_failure
  22. | Non_generalizable_class of {
    1. id : Ident.t;
    2. clty : Types.class_declaration;
    3. nongen_vars : Types.type_expr list;
    }
  23. | Cannot_coerce_self of Types.type_expr
  24. | Non_collapsable_conjunction of Ident.t * Types.class_declaration * Errortrace.unification_error
  25. | Self_clash of Errortrace.unification_error
  26. | Mutability_mismatch of string * Asttypes.mutable_flag
  27. | No_overriding of string * string
  28. | Duplicate of string * string
  29. | Closing_self_type of Types.class_signature
exception Error of Location.t * Env.t * error
exception Error_forward of Location.error
val report_error : Env.t -> Stdlib.Format.formatter -> error -> unit
val type_open_descr : (?used_slot:bool ref -> Env.t -> Parsetree.open_description -> Typedtree.open_description * Env.t) ref