Module Parsing0.Warnings

Warning definitions

Warning: this module is unstable and part of compiler-libs.

type loc = Melange_wrapper.Warnings.loc = {
  1. loc_start : Lexing.position;
  2. loc_end : Lexing.position;
  3. loc_ghost : bool;
}
type field_usage_warning =
  1. | Unused
  2. | Not_read
  3. | Not_mutated
type constructor_usage_warning =
  1. | Unused
  2. | Not_constructed
  3. | Only_exported_private
type t =
  1. | Comment_start
  2. | Comment_not_end
  3. | Fragile_match of string
  4. | Ignored_partial_application
  5. | Labels_omitted of string list
  6. | Method_override of string list
  7. | Partial_match of string
  8. | Missing_record_field_pattern of string
  9. | Non_unit_statement
  10. | Redundant_case
  11. | Redundant_subpat
  12. | Instance_variable_override of string list
  13. | Illegal_backslash
  14. | Implicit_public_methods of string list
  15. | Unerasable_optional_argument
  16. | Undeclared_virtual_method of string
  17. | Not_principal of string
  18. | Non_principal_labels of string
  19. | Ignored_extra_argument
  20. | Nonreturning_statement
  21. | Preprocessor of string
  22. | Useless_record_with
  23. | Bad_module_name of string
  24. | All_clauses_guarded
  25. | Unused_var of string
  26. | Unused_var_strict of string
  27. | Wildcard_arg_to_constant_constr
  28. | Eol_in_string
  29. | Duplicate_definitions of string * string * string * string
  30. | Unused_value_declaration of string
  31. | Unused_open of string
  32. | Unused_type_declaration of string
  33. | Unused_for_index of string
  34. | Unused_ancestor of string
  35. | Unused_constructor of string * constructor_usage_warning
  36. | Unused_extension of string * bool * constructor_usage_warning
  37. | Unused_rec_flag
  38. | Name_out_of_scope of string * string list * bool
  39. | Ambiguous_name of string list * string list * bool * string
  40. | Disambiguated_name of string
  41. | Nonoptional_label of string
  42. | Open_shadow_identifier of string * string
  43. | Open_shadow_label_constructor of string * string
  44. | Bad_env_variable of string * string
  45. | Attribute_payload of string * string
  46. | Eliminated_optional_arguments of string list
  47. | No_cmi_file of string * string option
  48. | Unexpected_docstring of bool
  49. | Fragile_literal_pattern
  50. | Misplaced_attribute of string
  51. | Duplicated_attribute of string
  52. | Inlining_impossible of string
  53. | Unreachable_case
  54. | Ambiguous_var_in_pattern_guard of string list
  55. | Flambda_assignment_to_non_mutable_value
  56. | Unused_module of string
  57. | Unboxable_type_in_prim_decl of string
  58. | Constraint_on_gadt
  59. | Erroneous_printed_signature of string
  60. | Unsafe_array_syntax_without_parsing
  61. | Redefining_unit of string
  62. | Unused_open_bang of string
  63. | Unused_functor_parameter of string
  64. | Match_on_mutable_state_prevent_uncurry
  65. | Unused_field of string * field_usage_warning
  66. | Missing_mli
  67. | Unused_tmc_attribute
  68. | Tmc_breaks_tailcall
  69. | Bs_unused_attribute of string
  70. | Bs_polymorphic_comparison
  71. | Bs_ffi_warning of string
  72. | Bs_derive_warning of string
  73. | Bs_fragile_external of string
  74. | Bs_unimplemented_primitive of string
  75. | Bs_integer_literal_overflow
  76. | Bs_uninterpreted_delimiters of string
  77. | Bs_toplevel_expression_unit
type alert = Melange_wrapper.Warnings.alert = {
  1. kind : string;
  2. message : string;
  3. def : loc;
  4. use : loc;
}
val parse_options : bool -> string -> alert option
val parse_alert_option : string -> unit

Disable/enable alerts based on the parameter to the -alert command-line option. Raises Arg.Bad if the string is not a valid specification.

val without_warnings : (unit -> 'a) -> 'a

Run the thunk with all warnings and alerts disabled.

val is_active : t -> bool
val is_error : t -> bool
val defaults_w : string
val defaults_warn_error : string
type reporting_information = Melange_wrapper.Warnings.reporting_information = {
  1. id : string;
  2. message : string;
  3. is_error : bool;
  4. sub_locs : (loc * string) list;
}
val report : t -> [ `Active of reporting_information | `Inactive ]
val report_alert : alert -> [ `Active of reporting_information | `Inactive ]
exception Errors
val check_fatal : unit -> unit
val reset_fatal : unit -> unit
val help_warnings : unit -> unit
type state
val backup : unit -> state
val restore : state -> unit
val with_state : state -> (unit -> 'a) -> 'a
val mk_lazy : (unit -> 'a) -> 'a Lazy.t

Like Lazy.of_fun, but the function is applied with the warning/alert settings at the time mk_lazy is called.

val nerrors : int ref
val message : t -> string
val number : t -> int
type description = {
  1. number : int;
  2. names : string list;
  3. description : string;
}
val descriptions : description list