2 * Copyright (c) 2015, Facebook, Inc.
5 * This source code is licensed under the MIT license found in the
6 * LICENSE file in the "hack" directory of this source tree.
14 val get_message_pos
: 'a message
-> 'a
16 val get_message_str
: 'a message
-> string
18 type error
= Pos.t error_
[@@deriving eq
]
20 type applied_fixme
= Pos.t
* int
22 module type Error_category
= sig
29 val of_enum
: int -> t
option
31 val show
: t
-> string
33 val err_code
: t
-> int
36 (* The analysis phase that the error is coming from. *)
54 type typing_error_callback
= ?code
:int -> (Pos.t
* string) list
-> unit
64 module Parsing
: Error_category
66 module Naming
: Error_category
68 module NastCheck
: Error_category
70 module Typing
: Error_category
72 val read_lines
: string -> string list
74 val num_digits
: int -> int
76 val add_error
: error
-> unit
78 val add_error_with_check
: error
-> unit
80 (* Error codes that can be suppressed in strict mode with a FIXME based on configuration. *)
81 val allowed_fixme_codes_strict
: ISet.t
ref
83 val allowed_fixme_codes_partial
: ISet.t
ref
85 val codes_not_raised_partial
: ISet.t
ref
87 (* Error codes that should be treated strictly, regardless of their file mode. *)
88 val error_codes_treated_strictly
: ISet.t
ref
90 val report_pos_from_reason
: bool ref
92 val is_strict_code
: int -> bool
94 val set_allow_errors_in_default_path
: bool -> unit
96 val is_hh_fixme
: (Pos.t
-> int -> bool) ref
98 val is_hh_fixme_disallowed
: (Pos.t
-> int -> bool) ref
100 val get_hh_fixme_pos
: (Pos.t
-> int -> Pos.t
option) ref
102 val to_list
: 'a error_
-> ('a
* string) list
104 val get_code
: 'a error_
-> int
106 val get_pos
: error
-> Pos.t
108 val get_severity
: 'a error_
-> severity
110 val get_messages
: 'a error_
-> 'a message list
112 val make_error
: int -> (Pos.t
* string) list
-> error
114 val make_absolute_error
:
115 int -> (Pos.absolute
* string) list
-> Pos.absolute error_
117 val error_code_to_string
: int -> string
119 val phase_to_string
: phase
-> string
121 val phase_of_string
: string -> phase
option
123 val name_context_to_string
: name_context
-> string
125 val internal_error
: Pos.t
-> string -> unit
127 val unimplemented_feature
: Pos.t
-> string -> unit
129 val experimental_feature
: Pos.t
-> string -> unit
131 val fixme_format
: Pos.t
-> unit
133 val missing_field
: Pos.t
-> Pos.t
-> string -> typing_error_callback
-> unit
135 val violated_constraint
:
138 (Pos.t
* string) list
->
139 (Pos.t
* string) list
->
140 typing_error_callback
->
143 val method_variance
: Pos.t
-> unit
145 val explain_constraint
:
147 definition_pos
:Pos.t
->
149 (Pos.t
* string) list
->
152 val explain_where_constraint
:
155 definition_pos
:Pos.t
->
156 (Pos.t
* string) list
->
159 val explain_tconst_where_constraint
:
160 use_pos
:Pos.t
-> definition_pos
:Pos.t
-> (Pos.t
* string) list
-> unit
162 val abstract_tconst_not_allowed
: Pos.t
-> Pos.t
* string -> unit
164 val unexpected_arrow
: Pos.t
-> string -> unit
166 val missing_arrow
: Pos.t
-> string -> unit
168 val disallowed_xhp_type
: Pos.t
-> string -> unit
170 val name_is_reserved
: string -> Pos.t
-> unit
172 val dollardollar_unused
: Pos.t
-> unit
174 val mutating_const_property
: Pos.t
-> unit
176 val self_const_parent_not
: Pos.t
-> unit
178 val overriding_prop_const_mismatch
:
179 Pos.t
-> bool -> Pos.t
-> bool -> typing_error_callback
-> unit
181 val method_name_already_bound
: Pos.t
-> string -> unit
183 val error_name_already_bound
: string -> string -> Pos.t
-> Pos.t
-> unit
185 val error_class_attribute_already_bound
:
186 string -> string -> Pos.t
-> Pos.t
-> unit
188 val unbound_name
: Pos.t
-> string -> name_context
-> unit
190 val invalid_fun_pointer
: Pos.t
-> string -> unit
192 val undefined
: in_rx_scope
:bool -> Pos.t
-> string -> string option -> unit
194 val this_reserved
: Pos.t
-> unit
196 val start_with_T
: Pos.t
-> unit
198 val already_bound
: Pos.t
-> string -> unit
200 val unexpected_typedef
: Pos.t
-> Pos.t
-> name_context
-> unit
202 val fd_name_already_bound
: Pos.t
-> unit
204 val mk_fd_name_already_bound
: Pos.t
-> error
206 val repeated_record_field
: string -> Pos.t
-> Pos.t
-> unit
208 val unexpected_record_field_name
:
211 record_name
:string ->
215 val missing_record_field_name
:
218 record_name
:string ->
219 field_decl_pos
:Pos.t
->
222 val type_not_record
: string -> Pos.t
-> unit
224 val primitive_toplevel
: Pos.t
-> unit
226 val primitive_invalid_alias
: Pos.t
-> string -> string -> unit
228 val dynamic_new_in_strict_mode
: Pos.t
-> unit
230 val xhp_optional_required_attr
: Pos.t
-> string -> unit
232 val xhp_required_with_default
: Pos.t
-> string -> unit
234 val array_typehints_disallowed
: Pos.t
-> unit
236 val wildcard_hint_disallowed
: Pos.t
-> unit
238 val wildcard_param_disallowed
: Pos.t
-> unit
240 val object_cast
: Pos.t
-> unit
242 val this_no_argument
: Pos.t
-> unit
244 val this_hint_outside_class
: Pos.t
-> unit
246 val this_type_forbidden
: Pos.t
-> unit
248 val nonstatic_property_with_lsb
: Pos.t
-> unit
250 val lowercase_this
: Pos.t
-> string -> unit
252 val classname_param
: Pos.t
-> unit
254 val typaram_applied_to_type
: Pos.t
-> string -> unit
256 val tparam_with_tparam
: Pos.t
-> string -> unit
258 val shadowed_type_param
: Pos.t
-> Pos.t
-> string -> unit
260 val missing_typehint
: Pos.t
-> unit
262 val expected_variable
: Pos.t
-> unit
264 val clone_too_many_arguments
: Pos.t
-> unit
266 val naming_too_few_arguments
: Pos.t
-> unit
268 val naming_too_many_arguments
: Pos.t
-> unit
270 val expected_collection
: Pos.t
-> string -> unit
272 val illegal_CLASS
: Pos.t
-> unit
274 val illegal_TRAIT
: Pos.t
-> unit
276 val nullsafe_property_write_context
: Pos.t
-> unit
278 val illegal_fun
: Pos.t
-> unit
280 val illegal_member_variable_class
: Pos.t
-> unit
282 val illegal_meth_fun
: Pos.t
-> unit
284 val illegal_inst_meth
: Pos.t
-> unit
286 val illegal_meth_caller
: Pos.t
-> unit
288 val illegal_class_meth
: Pos.t
-> unit
290 val class_meth_non_final_self
: Pos.t
-> string -> unit
292 val class_meth_non_final_CLASS
: Pos.t
-> bool -> string -> unit
294 val assert_arity
: Pos.t
-> unit
296 val unexpected_ty_in_tast
:
297 Pos.t
-> actual_ty
:string -> expected_ty
:string -> unit
299 val uninstantiable_class
:
300 Pos.t
-> Pos.t
-> string -> (Pos.t
* string) list
-> unit
302 val new_abstract_record
: Pos.t
* string -> unit
304 val abstract_const_usage
: Pos.t
-> Pos.t
-> string -> unit
306 val concrete_const_interface_override
:
307 Pos.t
-> Pos.t
-> string -> string -> typing_error_callback
-> unit
309 val const_without_typehint
: Pos.t
* string -> unit
311 val prop_without_typehint
: string -> Pos.t
* string -> unit
313 val illegal_constant
: Pos.t
-> unit
315 val parsing_error
: Pos.t
* string -> unit
317 val xhp_parsing_error
: Pos.t
* string -> unit
320 Pos.t
-> string -> string -> Pos.t
-> string -> string -> unit
322 val expected_literal_format_string
: Pos.t
-> unit
324 val re_prefixed_non_string
: Pos.t
-> string -> unit
326 val bad_regex_pattern
: Pos.t
-> string -> unit
328 val generic_array_strict
: Pos.t
-> unit
330 val option_return_only_typehint
: Pos.t
-> [< `void
| `noreturn
] -> unit
332 val tuple_syntax
: Pos.t
-> unit
334 val redeclaring_missing_method
: Pos.t
-> string -> unit
336 val expecting_type_hint
: Pos.t
-> unit
338 val expecting_type_hint_variadic
: Pos.t
-> unit
340 val expecting_return_type_hint
: Pos.t
-> unit
342 val expecting_awaitable_return_type_hint
: Pos.t
-> unit
344 val field_kinds
: Pos.t
-> Pos.t
-> unit
346 val unbound_name_typing
: Pos.t
-> string -> unit
348 val did_you_mean_naming
: Pos.t
-> string -> Pos.t
-> string -> unit
350 val previous_default
: Pos.t
-> unit
352 val return_only_typehint
: Pos.t
-> [< `void
| `noreturn
] -> unit
354 val unexpected_type_arguments
: Pos.t
-> unit
356 val too_many_type_arguments
: Pos.t
-> unit
358 val return_in_void
: Pos.t
-> Pos.t
-> unit
360 val this_var_outside_class
: Pos.t
-> unit
362 val unbound_global
: Pos.t
-> unit
364 val private_inst_meth
: def_pos
:Pos.t
-> use_pos
:Pos.t
-> unit
366 val protected_inst_meth
: def_pos
:Pos.t
-> use_pos
:Pos.t
-> unit
368 val private_class_meth
: def_pos
:Pos.t
-> use_pos
:Pos.t
-> unit
370 val protected_class_meth
: def_pos
:Pos.t
-> use_pos
:Pos.t
-> unit
372 val array_cast
: Pos.t
-> unit
374 val string_cast
: Pos.t
-> string -> unit
376 val static_outside_class
: Pos.t
-> unit
378 val self_outside_class
: Pos.t
-> unit
380 val new_inconsistent_construct
:
381 Pos.t
-> Pos.t
* string -> [< `static
| `classname
] -> unit
383 val undefined_parent
: Pos.t
-> unit
385 val parent_outside_class
: Pos.t
-> unit
387 val parent_abstract_call
: string -> Pos.t
-> Pos.t
-> unit
389 val self_abstract_call
: string -> Pos.t
-> Pos.t
-> unit
391 val classname_abstract_call
: string -> string -> Pos.t
-> Pos.t
-> unit
393 val static_synthetic_method
: string -> string -> Pos.t
-> Pos.t
-> unit
395 val isset_in_strict
: Pos.t
-> unit
397 val unset_nonidx_in_strict
: Pos.t
-> (Pos.t
* string) list
-> unit
399 val unpacking_disallowed_builtin_function
: Pos.t
-> string -> unit
401 val invalid_destructure
:
402 Pos.t
-> Pos.t
-> string -> typing_error_callback
-> unit
404 val unpack_array_required_argument
:
405 Pos.t
-> Pos.t
-> typing_error_callback
-> unit
407 val unpack_array_variadic_argument
:
408 Pos.t
-> Pos.t
-> typing_error_callback
-> unit
410 val array_get_arity
: Pos.t
-> string -> Pos.t
-> unit
412 val typing_error
: Pos.t
-> string -> unit
414 val undefined_field
:
415 use_pos
:Pos.t
-> name
:string -> shape_type_pos
:Pos.t
-> unit
417 val array_access_read
: Pos.t
-> Pos.t
-> string -> unit
419 val array_access_write
: Pos.t
-> Pos.t
-> string -> unit
421 val keyset_set
: Pos.t
-> Pos.t
-> unit
423 val array_append
: Pos.t
-> Pos.t
-> string -> unit
425 val const_mutation
: Pos.t
-> Pos.t
-> string -> unit
427 val expected_class
: ?suffix
:string -> Pos.t
-> unit
429 val unknown_type
: string -> Pos.t
-> (Pos.t
* string) list
-> unit
431 val smember_not_found
:
432 [< `class_constant
| `class_variable
| `static_method
| `class_typeconst
] ->
436 [< `closest
of Pos.t
* string | `did_you_mean
of Pos.t
* string | `no_hint
] ->
437 typing_error_callback
->
440 val member_not_found
:
441 [< `property
| `method_
] ->
445 [< `closest
of Pos.t
* string | `did_you_mean
of Pos.t
* string | `no_hint
] ->
446 (Pos.t
* string) list
->
447 typing_error_callback
->
450 val parent_in_trait
: Pos.t
-> unit
452 val parent_undefined
: Pos.t
-> unit
454 val constructor_no_args
: Pos.t
-> unit
456 val visibility
: Pos.t
-> string -> Pos.t
-> string -> unit
458 val typing_too_many_args
:
459 int -> int -> Pos.t
-> Pos.t
-> typing_error_callback
option -> unit
461 val typing_too_few_args
:
462 int -> int -> Pos.t
-> Pos.t
-> typing_error_callback
option -> unit
464 val bad_call
: Pos.t
-> string -> unit
466 val extend_final
: Pos.t
-> Pos.t
-> string -> unit
468 val extend_non_abstract_record
: string -> Pos.t
-> Pos.t
-> unit
470 val extend_sealed
: Pos.t
-> Pos.t
-> string -> string -> string -> unit
472 val trait_prop_const_class
: Pos.t
-> string -> unit
475 Pos.t
-> string -> bool -> Pos.t
-> string -> string -> string -> unit
477 val read_before_write
: Pos.t
* string -> unit
479 val implement_abstract
:
480 is_final
:bool -> Pos.t
-> Pos.t
-> string -> string -> unit
482 val generic_static
: Pos.t
-> string -> unit
484 val fun_too_many_args
: Pos.t
-> Pos.t
-> typing_error_callback
-> unit
486 val fun_too_few_args
: Pos.t
-> Pos.t
-> typing_error_callback
-> unit
488 val fun_unexpected_nonvariadic
: Pos.t
-> Pos.t
-> typing_error_callback
-> unit
490 val fun_variadicity_hh_vs_php56
:
491 Pos.t
-> Pos.t
-> typing_error_callback
-> unit
493 val expected_tparam
:
495 definition_pos
:Pos.t
->
497 typing_error_callback
option ->
500 val object_string
: Pos.t
-> Pos.t
-> unit
502 val object_string_deprecated
: Pos.t
-> unit
504 val cyclic_typedef
: Pos.t
-> Pos.t
-> unit
506 val type_arity_mismatch
:
507 Pos.t
-> string -> Pos.t
-> string -> typing_error_callback
-> unit
509 val this_final
: Pos.t
* string -> Pos.t
-> (Pos.t
* string) list
511 val exact_class_final
: Pos.t
* string -> Pos.t
-> (Pos.t
* string) list
513 val fun_arity_mismatch
: Pos.t
-> Pos.t
-> typing_error_callback
-> unit
515 val discarded_awaitable
: Pos.t
-> Pos.t
-> unit
517 val unify_error
: typing_error_callback
519 val unify_error_at
: Pos.t
-> typing_error_callback
521 val index_type_mismatch
: typing_error_callback
523 val expected_stringlike
: typing_error_callback
525 val type_constant_mismatch
: typing_error_callback
-> typing_error_callback
527 val class_constant_type_mismatch
:
528 typing_error_callback
-> typing_error_callback
530 val constant_does_not_match_enum_type
: typing_error_callback
532 val enum_underlying_type_must_be_arraykey
: typing_error_callback
534 val enum_constraint_must_be_arraykey
: typing_error_callback
536 val enum_subtype_must_have_compatible_constraint
: typing_error_callback
538 val parameter_default_value_wrong_type
: typing_error_callback
540 val newtype_alias_must_satisfy_constraint
: typing_error_callback
542 val bad_function_typevar
: typing_error_callback
544 val bad_class_typevar
: typing_error_callback
546 val bad_method_typevar
: typing_error_callback
548 val missing_return
: typing_error_callback
550 val inout_return_type_mismatch
: typing_error_callback
552 val class_constant_value_does_not_match_hint
: typing_error_callback
554 val class_property_initializer_type_does_not_match_hint
: typing_error_callback
556 val xhp_attribute_does_not_match_hint
: typing_error_callback
558 val pocket_universes_typing
: typing_error_callback
560 val record_init_value_does_not_match_hint
: typing_error_callback
562 val static_redeclared_as_dynamic
:
563 Pos.t
-> Pos.t
-> string -> elt_type
:[ `Method
| `Property
] -> unit
565 val dynamic_redeclared_as_static
:
566 Pos.t
-> Pos.t
-> string -> elt_type
:[ `Method
| `Property
] -> unit
568 val null_member_read
:
569 is_method
:bool -> string -> Pos.t
-> (Pos.t
* string) list
-> unit
571 val null_member_write
:
572 is_method
:bool -> string -> Pos.t
-> (Pos.t
* string) list
-> unit
574 val top_member_read
:
583 val top_member_write
:
592 val non_object_member_read
:
598 typing_error_callback
->
601 val non_object_member_write
:
607 typing_error_callback
->
610 val unknown_object_member
:
611 is_method
:bool -> string -> Pos.t
-> (Pos.t
* string) list
-> unit
613 val non_class_member
:
614 is_method
:bool -> string -> Pos.t
-> string -> Pos.t
-> unit
616 val ambiguous_member
:
617 is_method
:bool -> string -> Pos.t
-> string -> Pos.t
-> unit
619 val null_container
: Pos.t
-> (Pos.t
* string) list
-> unit
621 val option_mixed
: Pos.t
-> unit
623 val option_null
: Pos.t
-> unit
625 val declared_covariant
: Pos.t
-> Pos.t
-> (Pos.t
* string) list
-> unit
627 val declared_contravariant
: Pos.t
-> Pos.t
-> (Pos.t
* string) list
-> unit
629 val static_property_type_generic_param
:
630 class_pos
:Pos.t
-> var_type_pos
:Pos.t
-> generic_pos
:Pos.t
-> unit
632 val contravariant_this
: Pos.t
-> string -> string -> unit
634 val wrong_extend_kind
:
636 parent_kind
:Ast_defs.class_kind
->
637 parent_name
:string ->
639 child_kind
:Ast_defs.class_kind
->
643 val unsatisfied_req
: Pos.t
-> string -> Pos.t
-> unit
645 val cyclic_class_def
: SSet.t
-> Pos.t
-> unit
647 val cyclic_record_def
: string list
-> Pos.t
-> unit
649 val trait_reuse
: Pos.t
-> string -> Pos.t
* string -> string -> unit
651 val trait_reuse_inside_class
: Pos.t
* string -> string -> Pos.t list
-> unit
653 val invalid_is_as_expression_hint
:
654 string -> Pos.t
-> (Pos.t
* string) list
-> unit
656 val invalid_enforceable_type
:
657 string -> Pos.t
* string -> Pos.t
-> (Pos.t
* string) list
-> unit
659 val reifiable_attr
: Pos.t
-> string -> Pos.t
-> (Pos.t
* string) list
-> unit
661 val invalid_newable_type_argument
: Pos.t
* string -> Pos.t
-> unit
663 val invalid_newable_type_param_constraints
:
664 Pos.t
* string -> string list
-> unit
667 parent
:Pos.t
-> child
:Pos.t
-> on_error
:typing_error_callback
option -> unit
669 val override_memoizelsb
:
670 parent
:Pos.t
-> child
:Pos.t
-> typing_error_callback
-> unit
673 member_name
:string ->
676 typing_error_callback
->
679 val should_be_override
: Pos.t
-> string -> string -> unit
681 val override_per_trait
: Pos.t
* string -> string -> Pos.t
-> unit
683 val missing_assign
: Pos.t
-> unit
685 val private_override
: Pos.t
-> string -> string -> unit
687 val invalid_memoized_param
: Pos.t
-> (Pos.t
* string) list
-> unit
689 val no_construct_parent
: Pos.t
-> unit
691 val constructor_required
: Pos.t
* string -> string list
-> unit
693 val not_initialized
: Pos.t
* string -> (Pos.t
* string) list
-> unit
695 val call_before_init
: Pos.t
-> string -> unit
697 val type_arity
: Pos.t
-> Pos.t
-> expected
:int -> actual
:int -> unit
699 val invalid_req_implements
: Pos.t
-> unit
701 val invalid_req_extends
: Pos.t
-> unit
703 val abstract_with_body
: Pos.t
* 'a
-> unit
705 val not_abstract_without_body
: Pos.t
* 'a
-> unit
707 val return_in_gen
: Pos.t
-> unit
709 val return_in_finally
: Pos.t
-> unit
711 val toplevel_break
: Pos.t
-> unit
713 val toplevel_continue
: Pos.t
-> unit
715 val continue_in_switch
: Pos.t
-> unit
717 val await_in_sync_function
: Pos.t
-> unit
719 val await_in_coroutine
: Pos.t
-> unit
721 val yield_in_coroutine
: Pos.t
-> unit
723 val suspend_outside_of_coroutine
: Pos.t
-> unit
725 val suspend_in_finally
: Pos.t
-> unit
727 val static_memoized_function
: Pos.t
-> unit
729 val magic
: Pos.t
* string -> unit
731 val non_interface
: Pos.t
-> string -> string -> unit
733 val toString_returns_string
: Pos.t
-> unit
735 val toString_visibility
: Pos.t
-> unit
737 val uses_non_trait
: Pos.t
-> string -> string -> unit
739 val requires_non_class
: Pos.t
-> string -> string -> unit
741 val requires_final_class
: Pos.t
-> string -> unit
743 val abstract_body
: Pos.t
-> unit
745 val interface_with_member_variable
: Pos.t
-> unit
747 val interface_with_static_member_variable
: Pos.t
-> unit
749 val illegal_function_name
: Pos.t
-> string -> unit
751 val case_fallthrough
: Pos.t
-> Pos.t
-> unit
753 val default_fallthrough
: Pos.t
-> unit
755 val visibility_extends
:
756 string -> Pos.t
-> Pos.t
-> string -> typing_error_callback
-> unit
758 val member_not_implemented
: string -> Pos.t
-> Pos.t
-> Pos.t
-> unit
760 val bad_decl_override
:
761 Pos.t
-> string -> Pos.t
-> string -> (Pos.t
* string) list
-> unit
763 val bad_method_override
:
764 Pos.t
-> string -> (Pos.t
* string) list
-> typing_error_callback
-> unit
766 val bad_prop_override
:
767 Pos.t
-> string -> (Pos.t
* string) list
-> typing_error_callback
-> unit
769 val bad_enum_decl
: Pos.t
-> (Pos.t
* string) list
-> unit
771 val missing_constructor
: Pos.t
-> typing_error_callback
-> unit
773 val enum_constant_type_bad
: Pos.t
-> Pos.t
-> string -> Pos.t list
-> unit
775 val enum_type_bad
: Pos.t
-> string -> Pos.t list
-> unit
777 val enum_type_typedef_nonnull
: Pos.t
-> unit
779 val enum_switch_redundant
: string -> Pos.t
-> Pos.t
-> unit
781 val enum_switch_nonexhaustive
: Pos.t
-> string list
-> Pos.t
-> unit
783 val enum_switch_redundant_default
: Pos.t
-> Pos.t
-> unit
785 val enum_switch_not_const
: Pos.t
-> unit
787 val enum_switch_wrong_class
: Pos.t
-> string -> string -> unit
789 val invalid_shape_field_name
: Pos.t
-> unit
791 val invalid_shape_field_name_empty
: Pos.t
-> unit
793 val invalid_shape_field_type
: Pos.t
-> Pos.t
-> string -> Pos.t list
-> unit
795 val invalid_shape_field_literal
: Pos.t
-> Pos.t
-> unit
797 val invalid_shape_field_const
: Pos.t
-> Pos.t
-> unit
799 val shape_field_class_mismatch
: Pos.t
-> Pos.t
-> string -> string -> unit
801 val shape_field_type_mismatch
: Pos.t
-> Pos.t
-> string -> string -> unit
803 val shape_fields_unknown
: Pos.t
-> Pos.t
-> typing_error_callback
-> unit
805 val invalid_shape_remove_key
: Pos.t
-> unit
807 val using_internal_class
: Pos.t
-> string -> unit
809 val nullsafe_not_needed
: Pos.t
-> (Pos.t
* string) list
-> unit
811 val trivial_strict_eq
:
814 (Pos.t
* string) list
->
815 (Pos.t
* string) list
->
820 val trivial_strict_not_nullable_compare_null
:
821 Pos.t
-> string -> (Pos.t
* string) list
-> unit
823 val void_usage
: Pos.t
-> (Pos.t
* string) list
-> unit
825 val noreturn_usage
: Pos.t
-> (Pos.t
* string) list
-> unit
827 val generic_at_runtime
: Pos.t
-> string -> unit
829 val generics_not_allowed
: Pos.t
-> unit
831 val interface_with_partial_typeconst
: Pos.t
-> unit
833 val multiple_xhp_category
: Pos.t
-> unit
835 val mk_multiple_xhp_category
: Pos.t
-> error
837 val not_abstract_without_typeconst
: Pos.t
* string -> unit
839 val mk_not_abstract_without_typeconst
: Pos.t
* string -> error
841 val typeconst_depends_on_external_tparam
: Pos.t
-> Pos.t
-> string -> unit
843 val invalid_type_access_root
: Pos.t
* string -> unit
845 val duplicate_user_attribute
: Pos.t
* string -> Pos.t
-> unit
847 val unbound_attribute_name
: Pos.t
-> string -> unit
849 val attribute_too_many_arguments
: Pos.t
-> string -> int -> unit
851 val attribute_too_few_arguments
: Pos.t
-> string -> int -> unit
853 val attribute_param_type
: Pos.t
-> string -> unit
855 val deprecated_use
: Pos.t
-> Pos.t
-> string -> unit
857 val cannot_declare_constant
:
858 [< `enum
| `trait
| `record
] -> Pos.t
-> Pos.t
* string -> unit
860 val ambiguous_inheritance
:
861 Pos.t
-> string -> string -> error
-> typing_error_callback
-> unit
863 val duplicate_interface
: Pos.t
-> string -> Pos.t list
-> unit
865 val cyclic_typeconst
: Pos.t
-> string list
-> unit
867 val abstract_concrete_override
:
868 Pos.t
-> Pos.t
-> [< `method_
| `typeconst
| `constant
| `property
] -> unit
870 val local_variable_modified_and_used
: Pos.t
-> Pos.t list
-> unit
872 val local_variable_modified_twice
: Pos.t
-> Pos.t list
-> unit
874 val assign_during_case
: Pos.t
-> unit
876 val cyclic_enum_constraint
: Pos.t
-> unit
878 val invalid_classname
: Pos.t
-> unit
880 val illegal_type_structure
: Pos.t
-> string -> unit
882 val illegal_typeconst_direct_access
: Pos.t
-> unit
884 val override_no_default_typeconst
: Pos.t
-> Pos.t
-> unit
886 val unification_cycle
: Pos.t
-> string -> unit
888 val eq_incompatible_types
:
889 Pos.t
-> (Pos.t
* string) list
-> (Pos.t
* string) list
-> unit
891 val comparison_invalid_types
:
892 Pos.t
-> (Pos.t
* string) list
-> (Pos.t
* string) list
-> unit
894 val final_property
: Pos.t
-> unit
896 val invalid_new_disposable
: Pos.t
-> unit
898 val invalid_disposable_hint
: Pos.t
-> string -> unit
900 val invalid_disposable_return_hint
: Pos.t
-> string -> unit
902 val invalid_return_disposable
: Pos.t
-> unit
904 val invalid_switch_case_value_type
: Pos.t
-> string -> string -> unit
906 val to_json
: Pos.absolute error_
-> Hh_json.json
908 val convert_errors_to_string
:
909 ?include_filename
:bool -> error list
-> string list
911 val combining_sort
: 'a list
-> f
:('a
-> string) -> 'a list
913 val to_string
: ?indent
:bool -> Pos.absolute error_
-> string
916 format
-> 'a error_ list
-> int -> int option -> string option
918 val try_
: (unit -> 'a
) -> (error
-> 'a
) -> 'a
920 val try_with_result
: (unit -> 'a
) -> ('a
-> error
-> 'a
) -> 'a
922 val try_with_error
: (unit -> 'a
) -> (unit -> 'a
) -> 'a
924 (* The type of collections of errors *)
925 type t
[@@deriving eq
]
927 val do_
: (unit -> 'a
) -> t
* 'a
929 val do_with_context
: Relative_path.t
-> phase
-> (unit -> 'a
) -> t
* 'a
931 val run_in_context
: Relative_path.t
-> phase
-> (unit -> 'a
) -> 'a
933 val run_in_decl_mode
: Relative_path.t
-> (unit -> 'a
) -> 'a
935 (* Run this function with span for the definition being checked.
936 * This is used to check that the primary position for errors is not located
937 * outside the span of the definition.
939 val run_with_span
: Pos.t
-> (unit -> 'a
) -> 'a
941 (** ignore errors produced by function passed in argument. *)
942 val ignore_
: (unit -> 'a
) -> 'a
944 val try_when
: (unit -> 'a
) -> when_
:(unit -> bool) -> do_
:(error
-> unit) -> 'a
946 val has_no_errors
: (unit -> 'a
) -> bool
948 val currently_has_errors
: unit -> bool
950 val to_absolute
: error
-> Pos.absolute error_
952 val to_absolute_for_test
: error
-> Pos.absolute error_
954 val merge
: t
-> t
-> t
956 val merge_into_current
: t
-> unit
958 val incremental_update_set
:
959 old
:t
-> new_
:t
-> rechecked
:Relative_path.Set.t
-> phase
-> t
961 val incremental_update_map
:
962 old
:t
-> new_
:t
-> rechecked
:'a
Relative_path.Map.t
-> phase
-> t
966 val is_empty
: t
-> bool
970 val get_error_list
: t
-> error list
972 val get_sorted_error_list
: t
-> error list
974 val from_error_list
: error list
-> t
976 val iter_error_list
: (error
-> unit) -> t
-> unit
979 ?phase
:phase
-> t
-> init
:'a
-> f
:(Relative_path.t
-> error
-> 'a
-> 'a
) -> 'a
984 source
:Relative_path.t
->
986 f
:(error
-> 'a
-> 'a
) ->
989 val get_failed_files
: t
-> phase
-> Relative_path.Set.t
991 val sort
: error list
-> error list
993 val get_applied_fixmes
: t
-> applied_fixme list
995 val too_few_type_arguments
: Pos.t
-> unit
997 val required_field_is_optional
:
998 Pos.t
-> Pos.t
-> string -> typing_error_callback
-> unit
1000 val array_get_with_optional_field
: Pos.t
-> Pos.t
-> string -> unit
1002 val goto_label_already_defined
: string -> Pos.t
-> Pos.t
-> unit
1004 val goto_label_undefined
: Pos.t
-> string -> unit
1006 val goto_label_defined_in_finally
: Pos.t
-> unit
1008 val goto_invoked_in_finally
: Pos.t
-> unit
1010 val method_needs_visibility
: Pos.t
-> unit
1012 val mk_method_needs_visibility
: Pos.t
-> error
1014 val dynamic_class_name_in_strict_mode
: Pos.t
-> unit
1016 val reading_from_append
: Pos.t
-> unit
1018 val nullable_cast
: Pos.t
-> string -> Pos.t
-> unit
1020 val non_call_argument_in_suspend
: Pos.t
-> (Pos.t
* string) list
-> unit
1022 val non_coroutine_call_in_suspend
: Pos.t
-> (Pos.t
* string) list
-> unit
1024 val coroutine_call_outside_of_suspend
: Pos.t
-> unit
1026 val function_is_not_coroutine
: Pos.t
-> string -> unit
1028 val coroutinness_mismatch
:
1029 bool -> Pos.t
-> Pos.t
-> typing_error_callback
-> unit
1031 val invalid_ppl_call
: Pos.t
-> string -> unit
1033 val invalid_ppl_static_call
: Pos.t
-> string -> unit
1035 val ppl_meth_pointer
: Pos.t
-> string -> unit
1037 val coroutine_outside_experimental
: Pos.t
-> unit
1039 val return_disposable_mismatch
:
1040 bool -> Pos.t
-> Pos.t
-> typing_error_callback
-> unit
1042 val fun_reactivity_mismatch
:
1043 Pos.t
-> string -> Pos.t
-> string -> typing_error_callback
-> unit
1045 val reassign_mutable_var
: in_collection
:bool -> Pos.t
-> unit
1047 val mutable_call_on_immutable
: Pos.t
-> Pos.t
-> Pos.t
option -> unit
1049 val mutable_argument_mismatch
: Pos.t
-> Pos.t
-> unit
1051 val invalid_mutable_return_result
: Pos.t
-> Pos.t
-> string -> unit
1053 val mutable_return_result_mismatch
:
1054 bool -> Pos.t
-> Pos.t
-> typing_error_callback
-> unit
1056 val mutable_attribute_on_function
: Pos.t
-> unit
1058 val mutable_methods_must_be_reactive
: Pos.t
-> string -> unit
1060 val mutable_return_annotated_decls_must_be_reactive
:
1061 string -> Pos.t
-> string -> unit
1063 val pu_expansion
: Pos.t
-> string -> string -> unit
1065 val pu_typing
: Pos.t
-> string -> string -> unit
1067 val pu_typing_not_supported
: Pos.t
-> unit
1069 val pu_typing_invalid_upper_bounds
: Pos.t
-> unit
1071 val pu_typing_refinement
: Pos.t
-> unit
1073 val pu_atom_missing
: Pos.t
-> string -> string -> string -> string -> unit
1075 val pu_atom_unknown
: Pos.t
-> string -> string -> string -> string -> unit
1077 val pu_localize
: Pos.t
-> string -> string -> unit
1079 val pu_invalid_access
: Pos.t
-> string -> unit
1081 val pu_reserved_syntax
: Pos.t
-> unit
1083 val pu_case_in_trait
: Pos.t
-> string -> unit
1085 val pu_attribute_invalid
: Pos.t
-> unit
1087 val pu_attribute_err
: Pos.t
-> string -> string -> string -> string -> unit
1089 val pu_attribute_dup
: Pos.t
-> string -> string -> unit
1091 val pu_attribute_suggestion
: Pos.t
-> string -> string -> unit
1093 val pu_attribute_not_necessary
: Pos.t
-> string -> unit
1095 val lvar_in_obj_get
: Pos.t
-> unit
1097 val invalid_freeze_target
: Pos.t
-> Pos.t
-> string -> unit
1099 val invalid_freeze_use
: Pos.t
-> unit
1101 val freeze_in_nonreactive_context
: Pos.t
-> unit
1103 val this_as_lexical_variable
: Pos.t
-> unit
1105 val dollardollar_lvalue
: Pos.t
-> unit
1107 val duplicate_using_var
: Pos.t
-> unit
1109 val illegal_disposable
: Pos.t
-> string -> unit
1111 val escaping_disposable
: Pos.t
-> unit
1113 val escaping_disposable_parameter
: Pos.t
-> unit
1115 val escaping_this
: Pos.t
-> unit
1117 val must_extend_disposable
: Pos.t
-> unit
1119 val accept_disposable_invariant
:
1120 Pos.t
-> Pos.t
-> typing_error_callback
-> unit
1122 val inout_params_in_coroutine
: Pos.t
-> unit
1124 val inout_params_special
: Pos.t
-> unit
1126 val inout_params_memoize
: Pos.t
-> Pos.t
-> unit
1128 val obj_set_reactive
: Pos.t
-> unit
1130 val static_property_in_reactive_context
: Pos.t
-> unit
1132 val inout_annotation_missing
: Pos.t
-> Pos.t
-> unit
1134 val inout_annotation_unexpected
: Pos.t
-> Pos.t
-> bool -> unit
1136 val inoutness_mismatch
: Pos.t
-> Pos.t
-> typing_error_callback
-> unit
1138 val xhp_required
: Pos.t
-> string -> (Pos.t
* string) list
-> unit
1140 val illegal_xhp_child
: Pos.t
-> (Pos.t
* string) list
-> unit
1142 val missing_xhp_required_attr
: Pos.t
-> string -> (Pos.t
* string) list
-> unit
1144 val nonreactive_function_call
: Pos.t
-> Pos.t
-> string -> Pos.t
option -> unit
1146 val nonreactive_indexing
: bool -> Pos.t
-> unit
1148 val inout_argument_bad_expr
: Pos.t
-> unit
1150 val inout_argument_bad_type
: Pos.t
-> (Pos.t
* string) list
-> unit
1152 val nonreactive_call_from_shallow
:
1153 Pos.t
-> Pos.t
-> string -> Pos.t
option -> unit
1155 val illegal_destructor
: Pos.t
-> unit
1157 val rx_enabled_in_non_rx_context
: Pos.t
-> unit
1159 val ambiguous_lambda
: Pos.t
-> (Pos.t
* string) list
-> unit
1161 val ellipsis_strict_mode
:
1162 require
:[< `Param_name
| `Type
| `Type_and_param_name
] -> Pos.t
-> unit
1164 val untyped_lambda_strict_mode
: Pos.t
-> unit
1166 val multiple_conditionally_reactive_annotations
: Pos.t
-> string -> unit
1168 val conditionally_reactive_annotation_invalid_arguments
:
1169 is_method
:bool -> Pos.t
-> unit
1171 val echo_in_reactive_context
: Pos.t
-> unit
1173 val superglobal_in_reactive_context
: Pos.t
-> string -> unit
1175 val rx_is_enabled_invalid_location
: Pos.t
-> unit
1177 val wrong_expression_kind_attribute
:
1178 string -> Pos.t
-> string -> Pos.t
-> string -> string -> unit
1180 val wrong_expression_kind_builtin_attribute
: string -> Pos.t
-> string -> unit
1182 val cannot_return_borrowed_value_as_immutable
: Pos.t
-> Pos.t
-> unit
1184 val decl_override_missing_hint
: Pos.t
-> typing_error_callback
-> unit
1186 val atmost_rx_as_rxfunc_invalid_location
: Pos.t
-> unit
1188 val no_atmost_rx_as_rxfunc_for_rx_if_args
: Pos.t
-> unit
1190 val coroutine_in_constructor
: Pos.t
-> unit
1192 val pu_duplication
: Pos.t
-> string -> string -> string -> unit
1194 val pu_duplication_in_instance
: Pos.t
-> string -> string -> string -> unit
1196 val pu_not_in_class
: Pos.t
-> string -> string -> unit
1198 val illegal_use_of_dynamically_callable
: Pos.t
-> Pos.t
-> string -> unit
1200 val parent_in_function_pointer
: Pos.t
-> string option -> string -> unit
1202 val self_in_non_final_function_pointer
:
1203 Pos.t
-> string option -> string -> unit
1205 val invalid_type_for_atmost_rx_as_rxfunc_parameter
: Pos.t
-> string -> unit
1207 val missing_annotation_for_atmost_rx_as_rxfunc_parameter
: Pos.t
-> unit
1209 val mutable_in_nonreactive_context
: Pos.t
-> unit
1211 val invalid_argument_of_rx_mutable_function
: Pos.t
-> unit
1213 val return_void_to_rx_mismatch
:
1214 pos1_has_attribute
:bool -> Pos.t
-> Pos.t
-> typing_error_callback
-> unit
1216 val returns_void_to_rx_function_as_non_expression_statement
:
1217 Pos.t
-> Pos.t
-> unit
1219 val non_awaited_awaitable_in_rx
: Pos.t
-> unit
1221 val shapes_key_exists_always_true
: Pos.t
-> string -> Pos.t
-> unit
1223 val shapes_key_exists_always_false
:
1227 [< `Undefined
| `Nothing
of (Pos.t
* string) list
] ->
1230 val shapes_method_access_with_non_existent_field
:
1235 [< `Undefined
| `Nothing
of (Pos.t
* string) list
] ->
1238 val shape_access_with_non_existent_field
:
1242 [< `Undefined
| `Nothing
of (Pos.t
* string) list
] ->
1245 val ambiguous_object_access
:
1246 Pos.t
-> string -> Pos.t
-> string -> Pos.t
-> string -> string -> unit
1248 val unserializable_type
: Pos.t
-> string -> unit
1250 val invalid_arraykey_read
: Pos.t
-> Pos.t
* string -> Pos.t
* string -> unit
1252 val invalid_arraykey_write
: Pos.t
-> Pos.t
* string -> Pos.t
* string -> unit
1254 val invalid_arraykey_constraint
: Pos.t
-> string -> unit
1256 val invalid_argument_type_for_condition_in_rx
:
1257 is_receiver
:bool -> Pos.t
-> Pos.t
-> Pos.t
-> string -> string -> unit
1259 val callsite_reactivity_mismatch
:
1260 Pos.t
-> Pos.t
-> string -> Pos.t
option -> string -> unit
1262 val rx_parameter_condition_mismatch
:
1263 string -> Pos.t
-> Pos.t
-> typing_error_callback
-> unit
1265 val maybe_mutable_attribute_on_function
: Pos.t
-> unit
1267 val conflicting_mutable_and_maybe_mutable_attributes
: Pos.t
-> unit
1269 val maybe_mutable_methods_must_be_reactive
: Pos.t
-> string -> unit
1271 val entrypoint_arguments
: Pos.t
-> unit
1273 val variadic_memoize
: Pos.t
-> unit
1275 val abstract_method_memoize
: Pos.t
-> unit
1277 val reassign_maybe_mutable_var
: in_collection
:bool -> Pos.t
-> unit
1279 val immutable_argument_mismatch
: Pos.t
-> Pos.t
-> unit
1281 val maybe_mutable_argument_mismatch
: Pos.t
-> Pos.t
-> unit
1283 val immutable_call_on_mutable
: Pos.t
-> Pos.t
-> unit
1285 val invalid_call_on_maybe_mutable
:
1286 fun_is_mutable
:bool -> Pos.t
-> Pos.t
-> unit
1288 val mutability_mismatch
:
1294 typing_error_callback
->
1297 val invalid_traversable_in_rx
: Pos.t
-> unit
1299 val reassign_mutable_this
:
1300 in_collection
:bool -> is_maybe_mutable
:bool -> Pos.t
-> unit
1302 val mutable_expression_as_multiple_mutable_arguments
:
1303 Pos.t
-> string -> Pos.t
-> string -> unit
1305 val invalid_unset_target_rx
: Pos.t
-> unit
1307 val lateinit_with_default
: Pos.t
-> unit
1309 val bad_lateinit_override
:
1310 bool -> Pos.t
-> Pos.t
-> typing_error_callback
-> unit
1312 val bad_xhp_attr_required_override
:
1313 string -> string -> Pos.t
-> Pos.t
-> typing_error_callback
-> unit
1315 val interface_use_trait
: Pos.t
-> unit
1317 val nonstatic_method_in_abstract_final_class
: Pos.t
-> unit
1319 val escaping_mutable_object
: Pos.t
-> unit
1321 val multiple_concrete_defs
:
1328 typing_error_callback
->
1331 val move_in_nonreactive_context
: Pos.t
-> unit
1333 val invalid_move_target
: Pos.t
-> Pos.t
-> string -> unit
1335 val invalid_move_use
: Pos.t
-> unit
1337 val require_args_reify
: Pos.t
-> Pos.t
-> unit
1339 val require_generic_explicit
: Pos.t
* string -> Pos.t
-> unit
1341 val invalid_reified_argument
:
1342 Pos.t
* string -> Pos.t
-> (Pos.t
* string) list
-> unit
1344 val invalid_reified_argument_reifiable
:
1345 Pos.t
* string -> Pos.t
-> Pos.t
-> string -> unit
1347 val new_static_class_reified
: Pos.t
-> unit
1349 val class_get_reified
: Pos.t
-> unit
1351 val consistent_construct_reified
: Pos.t
-> unit
1353 val reified_generics_not_allowed
: Pos.t
-> unit
1355 val bad_function_pointer_construction
: Pos.t
-> unit
1357 val new_without_newable
: Pos.t
-> string -> unit
1359 val mutably_owned_argument_mismatch
:
1360 arg_is_owned_local
:bool -> Pos.t
-> Pos.t
-> unit
1362 val rx_move_invalid_location
: Pos.t
-> unit
1364 val inconsistent_mutability
: Pos.t
-> string -> (Pos.t
* string) option -> unit
1366 val invalid_mutability_flavor
: Pos.t
-> string -> string -> unit
1368 val inconsistent_mutability_for_conditional
: Pos.t
-> Pos.t
-> unit
1370 val redundant_rx_condition
: Pos.t
-> unit
1372 val misplaced_mutability_hint
: Pos.t
-> unit
1374 val mutability_hint_in_non_rx_function
: Pos.t
-> unit
1376 val invalid_mutability_in_return_type_hint
: Pos.t
-> unit
1378 val typechecker_timeout
: Pos.t
* string -> int -> unit
1380 val switch_multiple_default
: Pos.t
-> unit
1382 val switch_non_terminal_default
: Pos.t
-> unit
1384 val unsupported_trait_use_as
: Pos.t
-> unit
1386 val mk_unsupported_trait_use_as
: Pos.t
-> error
1388 val unsupported_instead_of
: Pos.t
-> unit
1390 val mk_unsupported_instead_of
: Pos.t
-> error
1392 val invalid_trait_use_as_visibility
: Pos.t
-> unit
1394 val mk_invalid_trait_use_as_visibility
: Pos.t
-> error
1396 val unresolved_type_variable
: Pos.t
-> unit
1398 val invalid_sub_string
: Pos.t
-> string -> unit
1400 val php_lambda_disallowed
: Pos.t
-> unit
1402 val static_meth_with_class_reified_generic
: Pos.t
-> Pos.t
-> unit
1404 val exception_occurred
: Pos.t
-> Exception.t
-> unit
1406 val redundant_covariant
: Pos.t
-> string -> string -> unit
1408 val meth_caller_trait
: Pos.t
-> string -> unit
1410 val unsupported_hk_feature
:
1411 because_nested
:bool -> Pos.t
-> string -> string -> unit
1413 val tparam_non_shadowing_reuse
: Pos.t
-> string -> unit
1415 val illegal_information_flow
:
1416 Pos.t
-> Pos.t list
-> Pos.t list
* string -> Pos.t list
* string -> unit
1418 val context_implicit_policy_leakage
:
1419 Pos.t
-> Pos.t list
-> Pos.t list
* string -> Pos.t list
* string -> unit
1421 val reified_function_reference
: Pos.t
-> unit
1423 val class_meth_abstract_call
: string -> string -> Pos.t
-> Pos.t
-> unit
1425 val higher_kinded_partial_application
: Pos.t
-> int -> unit
1427 val wildcard_for_higher_kinded_type
: Pos.t
-> unit
1429 val implicit_type_argument_for_higher_kinded_type
:
1430 use_pos
:Pos.t
-> def_pos
:Pos.t
-> string -> unit
1435 tparam_name
:string ->
1436 expected_kind_repr
:string ->
1437 actual_kind_repr
:string ->