module Warnings: sig
.. end
type
loc = {
|
loc_start : Lexing.position ; |
|
loc_end : Lexing.position ; |
|
loc_ghost : bool ; |
}
val ghost_loc_in_file : string -> loc
type
field_usage_warning =
type
constructor_usage_warning =
type
t =
| |
|
| |
|
| |
Fragile_match of string |
| |
忽略的部分应用 |
| |
Labels_omitted of string list |
| |
Method_override of string list |
| |
Partial_match of string |
| |
Missing_record_field_pattern of string |
| |
非单元语句 |
| |
冗余情况 |
| |
冗余子模式 |
| |
Instance_variable_override of string list |
| |
非法反斜杠 |
| |
Implicit_public_methods of string list |
| |
不可擦除的可选参数 |
| |
Undeclared_virtual_method of string |
| |
Not_principal of string |
| |
Non_principal_labels of string |
| |
|
| |
非返回语句 |
| |
Preprocessor of string |
| |
无用的记录 with |
| |
Bad_module_name of string |
| |
所有子句都受保护 |
| |
Unused_var of string |
| |
Unused_var_strict of string |
| |
通配符参数到常量构造器 |
| |
字符串中的行尾 |
| |
Duplicate_definitions of string * string * string * string |
| |
Unused_value_declaration of string |
| |
Unused_open of string |
| |
Unused_type_declaration of string |
| |
Unused_for_index of string |
| |
Unused_ancestor of string |
| |
Unused_constructor of string * constructor_usage_warning |
| |
Unused_extension of string * bool * constructor_usage_warning |
| |
未使用 rec 标志 |
| |
Name_out_of_scope of string * string list * bool |
| |
Ambiguous_name of string list * string list * bool * string |
| |
Disambiguated_name of string |
| |
Nonoptional_label of string |
| |
Open_shadow_identifier of string * string |
| |
Open_shadow_label_constructor of string * string |
| |
Bad_env_variable of string * string |
| |
Attribute_payload of string * string |
| |
Eliminated_optional_arguments of string list |
| |
No_cmi_file of string * string option |
| |
Unexpected_docstring of bool |
| |
Wrong_tailcall_expectation of bool |
| |
脆弱的字面量模式 |
| |
Misplaced_attribute of string |
| |
Duplicated_attribute of string |
| |
Inlining_impossible of string |
| |
不可到达的情况 |
| |
Ambiguous_var_in_pattern_guard of string list |
| |
No_cmx_file of string |
| |
Flambda 对非可变值的赋值 |
| |
Unused_module of string |
| |
Unboxable_type_in_prim_decl of string |
| |
GADT 上的约束 |
| |
Erroneous_printed_signature of string |
| |
无解析的非安全数组语法 |
| |
Redefining_unit of string |
| |
Unused_open_bang of string |
| |
Unused_functor_parameter of string |
| |
可变状态上的匹配阻止了展开 |
| |
Unused_field of string * field_usage_warning |
| |
缺少 .mli 文件 |
| |
未使用的 tmc 属性 |
| |
tmc 破坏了尾调用 |
| |
生成式应用期望单元类型 |
type
alert = {
|
kind : string ; |
|
message : string ; |
|
def : loc ; |
|
use : loc ; |
}
val parse_options : bool -> string -> alert option
val parse_alert_option : string -> unit
根据 -alert 命令行选项的参数禁用/启用警告。如果字符串不是有效的规范,则引发 Arg.Bad
。
val without_warnings : (unit -> 'a) -> 'a
val is_active : t -> bool
val is_error : t -> bool
val defaults_w : string
val defaults_warn_error : string
type
reporting_information = {
|
id : string ; |
|
message : string ; |
|
is_error : bool ; |
|
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
类似于 Lazy.of_fun
,但该函数在调用 mk_lazy
时使用当时的警告/警报设置进行应用。
type
description = {
|
number : int ; |
|
names : string list ; |
|
description : string ; |
|
since : Sys.ocaml_release_info option ;
|
}
val descriptions : description list