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_typesharp_id : Ident.t;
  9. cls_abbr : Types.type_declaration;
  10. cls_arity : int;
  11. cls_pub_methods : string list;
  12. 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_typesharp_id : Ident.t;
  7. clsty_abbr : Types.type_declaration;
  8. 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
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 * Types.type_expr
  18. | Class_match_failure of Ctype.class_match_failure list
  19. | Unbound_val of string
  20. | Unbound_type_var of Stdlib.Format.formatter -> unit * Types.type_expr * bool * string * Types.type_expr
  21. | Non_generalizable_class of Ident.t * Types.class_declaration
  22. | Cannot_coerce_self of Types.type_expr
  23. | Non_collapsable_conjunction of Ident.t * Types.class_declaration * Errortrace.unification_error
  24. | Self_clash of Errortrace.unification_error
  25. | Mutability_mismatch of string * Asttypes.mutable_flag
  26. | No_overriding of string * string
  27. | Duplicate of string * string
  28. | 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