diff --git a/hphp/hack/src/typing/tast_check/cast_non_primitive.ml b/hphp/hack/src/typing/tast_check/cast_non_primitive.ml index dfa768e689a13..bd1edd3766475 100644 --- a/hphp/hack/src/typing/tast_check/cast_non_primitive.ml +++ b/hphp/hack/src/typing/tast_check/cast_non_primitive.ml @@ -90,7 +90,7 @@ let handler ~as_lint = ( pos, Typing_warning.Cast_non_primitive, { - Typing_warning.CastNonPrimitive.cast_hint = + Typing_warning.Cast_non_primitive.cast_hint = Env.print_hint env hint; ty = Env.print_ty env ty; } ) diff --git a/hphp/hack/src/typing/tast_check/disjoint_types.ml b/hphp/hack/src/typing/tast_check/disjoint_types.ml index f4ae4d71b7f17..b2b860bbaf3d5 100644 --- a/hphp/hack/src/typing/tast_check/disjoint_types.ml +++ b/hphp/hack/src/typing/tast_check/disjoint_types.ml @@ -34,7 +34,7 @@ let add_warning env p name ty1 ty2 ~dynamic ~as_lint = ( p, warning_kind, { - Typing_warning.NonDisjointCheck.name = Utils.strip_ns name; + Typing_warning.Non_disjoint_check.name = Utils.strip_ns name; dynamic; ty1 = Env.print_ty env ty1; ty2 = Env.print_ty env ty2; diff --git a/hphp/hack/src/typing/tast_check/duplicate_properties.ml b/hphp/hack/src/typing/tast_check/duplicate_properties.ml index ba56e514d69c4..57aae7bb99a75 100644 --- a/hphp/hack/src/typing/tast_check/duplicate_properties.ml +++ b/hphp/hack/src/typing/tast_check/duplicate_properties.ml @@ -108,7 +108,7 @@ let add_warning ( pos, warning_kind, { - Typing_warning.DuplicateProperties.class_name; + Typing_warning.Duplicate_properties.class_name; prop_name; class_names; initialized_with_constant; diff --git a/hphp/hack/src/typing/tast_check/equality_check.ml b/hphp/hack/src/typing/tast_check/equality_check.ml index 7ad804f074b87..226f48b78b92c 100644 --- a/hphp/hack/src/typing/tast_check/equality_check.ml +++ b/hphp/hack/src/typing/tast_check/equality_check.ml @@ -69,7 +69,7 @@ let add_warning env ~as_lint pos kind ty1 ty2 = Some None else None) - (pos, warning_kind, { Typing_warning.EqualityCheck.kind; ty1; ty2 }) + (pos, warning_kind, { Typing_warning.Equality_check.kind; ty1; ty2 }) let error_if_inequatable env ty1 ty2 err = let expand_tydef = @@ -100,21 +100,21 @@ let ensure_valid_equality_check env ~as_lint p bop e1 e2 = env ~as_lint p - (Typing_warning.EqualityCheck.Equality (equal_bop bop Diff2))) + (Typing_warning.Equality_check.Equality (equal_bop bop Diff2))) let ensure_valid_contains_check env ~as_lint p trv_val_ty val_ty = error_if_inequatable env trv_val_ty val_ty - (add_warning env ~as_lint p Typing_warning.EqualityCheck.Contains) + (add_warning env ~as_lint p Typing_warning.Equality_check.Contains) let ensure_valid_contains_key_check env ~as_lint p trv_key_ty key_ty = error_if_inequatable env trv_key_ty key_ty - (add_warning env ~as_lint p Typing_warning.EqualityCheck.Contains_key) + (add_warning env ~as_lint p Typing_warning.Equality_check.Contains_key) let handler ~as_lint = object diff --git a/hphp/hack/src/typing/tast_check/is_check.ml b/hphp/hack/src/typing/tast_check/is_check.ml index 115a99d8fa06d..3cab9129a09a5 100644 --- a/hphp/hack/src/typing/tast_check/is_check.ml +++ b/hphp/hack/src/typing/tast_check/is_check.ml @@ -75,7 +75,7 @@ let trivial_check ~as_lint pos env lhs_ty rhs_ty ~always_kind ~never_kind = ( pos, warning_kind, { - Typing_warning.IsAsAlways.kind; + Typing_warning.Is_as_always.kind; lhs_ty = print_ty lhs_ty; rhs_ty = print_ty rhs_ty; } ) @@ -101,8 +101,8 @@ let handler ~as_lint = env lhs_ty hint_ty - ~always_kind:Typing_warning.IsAsAlways.Is_is_always_true - ~never_kind:Typing_warning.IsAsAlways.Is_is_always_false + ~always_kind:Typing_warning.Is_as_always.Is_is_always_true + ~never_kind:Typing_warning.Is_as_always.Is_is_always_false | ( _, p, As @@ -120,13 +120,13 @@ let handler ~as_lint = lhs_ty hint_ty ~always_kind: - (Typing_warning.IsAsAlways.As_always_succeeds + (Typing_warning.Is_as_always.As_always_succeeds { Typing_warning.can_be_captured = Aast_utils.can_be_captured lhs_expr; original_pos = p; replacement_pos = lhs_pos; }) - ~never_kind:Typing_warning.IsAsAlways.As_always_fails + ~never_kind:Typing_warning.Is_as_always.As_always_fails | _ -> () end diff --git a/hphp/hack/src/typing/tast_check/sketchy_null_check.ml b/hphp/hack/src/typing/tast_check/sketchy_null_check.ml index 30ec1aa466717..c952c92b4679d 100644 --- a/hphp/hack/src/typing/tast_check/sketchy_null_check.ml +++ b/hphp/hack/src/typing/tast_check/sketchy_null_check.ml @@ -55,7 +55,7 @@ let sketchy_null_check env ~as_lint (ty, p, e) kind = ( p, warning_kind, { - Typing_warning.SketchyNullCheck.name; + Typing_warning.Sketchy_null_check.name; kind; ty = Tast_env.print_ty env ty; } ) @@ -75,16 +75,16 @@ let handler ~as_lint = env ~as_lint e - Typing_warning.SketchyNullCheck.Coalesce + Typing_warning.Sketchy_null_check.Coalesce | Unop (Unot, e) | Binop { bop = Eqeq; lhs = (_, _, Null); rhs = e } | Binop { bop = Eqeq; lhs = e; rhs = (_, _, Null) } -> - sketchy_null_check env ~as_lint e Typing_warning.SketchyNullCheck.Eq + sketchy_null_check env ~as_lint e Typing_warning.Sketchy_null_check.Eq | Eif (e, Some _, _) -> - sketchy_null_check env ~as_lint e Typing_warning.SketchyNullCheck.Neq + sketchy_null_check env ~as_lint e Typing_warning.Sketchy_null_check.Neq | Binop { bop = Ampamp | Barbar; lhs = e1; rhs = e2 } -> - sketchy_null_check env ~as_lint e1 Typing_warning.SketchyNullCheck.Neq; - sketchy_null_check env ~as_lint e2 Typing_warning.SketchyNullCheck.Neq + sketchy_null_check env ~as_lint e1 Typing_warning.Sketchy_null_check.Neq; + sketchy_null_check env ~as_lint e2 Typing_warning.Sketchy_null_check.Neq | _ -> () method! at_stmt env x = @@ -93,6 +93,6 @@ let handler ~as_lint = | Do (_, e) | While (e, _) | For (_, Some e, _, _) -> - sketchy_null_check env ~as_lint e Typing_warning.SketchyNullCheck.Neq + sketchy_null_check env ~as_lint e Typing_warning.Sketchy_null_check.Neq | _ -> () end diff --git a/hphp/hack/src/typing/tast_check/truthiness_test.ml b/hphp/hack/src/typing/tast_check/truthiness_test.ml index fd6eea2c1f8a1..ba6a87ccd7c9c 100644 --- a/hphp/hack/src/typing/tast_check/truthiness_test.ml +++ b/hphp/hack/src/typing/tast_check/truthiness_test.ml @@ -33,27 +33,41 @@ let add_warning env ~as_lint pos kind ty e not = None) ( pos, Typing_warning.Truthiness_test, - { Typing_warning.TruthinessTest.kind; ty; expr = get_lvar_name e; not } ) + { Typing_warning.Truthiness_test.kind; ty; expr = get_lvar_name e; not } + ) let truthiness_test env ~as_lint (ty, p, e) ~not : unit = - let module TruthinessTest = Typing_warning.TruthinessTest in let prim_to_string prim = Env.print_error_ty env (MakeType.prim_type (get_reason ty) prim) in List.iter (Tast_utils.find_sketchy_types env ty) ~f:(function | Tast_utils.String -> let tystr = prim_to_string Aast_defs.Tstring in - add_warning env ~as_lint p TruthinessTest.(Sketchy String) tystr e not + add_warning + env + ~as_lint + p + Typing_warning.Truthiness_test.(Sketchy String) + tystr + e + not | Tast_utils.Arraykey -> let tystr = prim_to_string Aast_defs.Tarraykey in - add_warning env ~as_lint p TruthinessTest.(Sketchy Arraykey) tystr e not + add_warning + env + ~as_lint + p + Typing_warning.Truthiness_test.(Sketchy Arraykey) + tystr + e + not | Tast_utils.Stringish -> let tystr = Utils.strip_ns SN.Classes.cStringish in add_warning env ~as_lint p - TruthinessTest.(Sketchy Stringish) + Typing_warning.Truthiness_test.(Sketchy Stringish) tystr e not @@ -63,7 +77,7 @@ let truthiness_test env ~as_lint (ty, p, e) ~not : unit = env ~as_lint p - TruthinessTest.(Sketchy Xhp_child) + Typing_warning.Truthiness_test.(Sketchy Xhp_child) tystr e not @@ -72,7 +86,7 @@ let truthiness_test env ~as_lint (ty, p, e) ~not : unit = env ~as_lint p - TruthinessTest.(Sketchy Traversable) + Typing_warning.Truthiness_test.(Sketchy Traversable) tystr e not); @@ -82,7 +96,7 @@ let truthiness_test env ~as_lint (ty, p, e) ~not : unit = env ~as_lint p - TruthinessTest.(Invalid { truthy = true }) + Typing_warning.Truthiness_test.(Invalid { truthy = true }) (Env.print_ty env ty) e not @@ -91,7 +105,7 @@ let truthiness_test env ~as_lint (ty, p, e) ~not : unit = env ~as_lint p - TruthinessTest.(Invalid { truthy = false }) + Typing_warning.Truthiness_test.(Invalid { truthy = false }) (Env.print_ty env ty) e not diff --git a/hphp/hack/src/typing/typing_equality_check.ml b/hphp/hack/src/typing/typing_equality_check.ml index f3e971db9b0df..457242ec3207a 100644 --- a/hphp/hack/src/typing/typing_equality_check.ml +++ b/hphp/hack/src/typing/typing_equality_check.ml @@ -39,7 +39,7 @@ let trivial_comparison_error ( pos, Typing_warning.Sketchy_equality, { - Typing_warning.SketchyEquality.result; + Typing_warning.Sketchy_equality.result; left; right; left_trail; diff --git a/hphp/hack/src/typing/typing_warning.ml b/hphp/hack/src/typing/typing_warning.ml index 5135200fbba35..471285aaaf59d 100644 --- a/hphp/hack/src/typing/typing_warning.ml +++ b/hphp/hack/src/typing/typing_warning.ml @@ -16,7 +16,7 @@ type quickfix = { replacement_pos: Pos.t; } -module IsAsAlways = struct +module Is_as_always = struct type kind = | Is_is_always_true | Is_is_always_false @@ -30,7 +30,7 @@ module IsAsAlways = struct } end -module SketchyNullCheck = struct +module Sketchy_null_check = struct type kind = | Coalesce | Eq @@ -43,7 +43,7 @@ module SketchyNullCheck = struct } end -module NonDisjointCheck = struct +module Non_disjoint_check = struct type t = { name: string; ty1: string; @@ -52,7 +52,7 @@ module NonDisjointCheck = struct } end -module SketchyEquality = struct +module Sketchy_equality = struct type t = { result: bool; left: Pos_or_decl.t Message.t list Lazy.t; @@ -62,14 +62,14 @@ module SketchyEquality = struct } end -module CastNonPrimitive = struct +module Cast_non_primitive = struct type t = { cast_hint: string; ty: string; } end -module TruthinessTest = struct +module Truthiness_test = struct type sketchy_kind = | String | Arraykey @@ -89,7 +89,7 @@ module TruthinessTest = struct } end -module EqualityCheck = struct +module Equality_check = struct type kind = | Equality of bool | Contains @@ -102,7 +102,7 @@ module EqualityCheck = struct } end -module DuplicateProperties = struct +module Duplicate_properties = struct type t = { class_name: string; prop_name: string; @@ -112,13 +112,13 @@ module DuplicateProperties = struct end type (_, _) kind = - | Sketchy_equality : (SketchyEquality.t, warn) kind - | Is_as_always : (IsAsAlways.t, migrated) kind - | Sketchy_null_check : (SketchyNullCheck.t, migrated) kind - | Non_disjoint_check : (NonDisjointCheck.t, migrated) kind - | Cast_non_primitive : (CastNonPrimitive.t, migrated) kind - | Truthiness_test : (TruthinessTest.t, migrated) kind - | Equality_check : (EqualityCheck.t, migrated) kind - | Duplicate_properties : (DuplicateProperties.t, migrated) kind + | Sketchy_equality : (Sketchy_equality.t, warn) kind + | Is_as_always : (Is_as_always.t, migrated) kind + | Sketchy_null_check : (Sketchy_null_check.t, migrated) kind + | Non_disjoint_check : (Non_disjoint_check.t, migrated) kind + | Cast_non_primitive : (Cast_non_primitive.t, migrated) kind + | Truthiness_test : (Truthiness_test.t, migrated) kind + | Equality_check : (Equality_check.t, migrated) kind + | Duplicate_properties : (Duplicate_properties.t, migrated) kind type ('x, 'a) t = Pos.t * ('x, 'a) kind * 'x diff --git a/hphp/hack/src/typing/typing_warning_utils.ml b/hphp/hack/src/typing/typing_warning_utils.ml index 8da6254fb4917..cc83af49d6dcf 100644 --- a/hphp/hack/src/typing/typing_warning_utils.ml +++ b/hphp/hack/src/typing/typing_warning_utils.ml @@ -35,8 +35,8 @@ module type Lint = sig val lint_quickfix : t -> Typing_warning.quickfix option end -module SketchyEquality = struct - type t = Typing_warning.SketchyEquality.t +module Sketchy_equality = struct + type t = Typing_warning.Sketchy_equality.t let code = Codes.SketchyEquality @@ -44,7 +44,7 @@ module SketchyEquality = struct let code _ = code - let claim { Typing_warning.SketchyEquality.result; _ } = + let claim { Typing_warning.Sketchy_equality.result; _ } = let b = Markdown_lite.md_codify (if result then @@ -56,7 +56,7 @@ module SketchyEquality = struct let reasons { - Typing_warning.SketchyEquality.result = _; + Typing_warning.Sketchy_equality.result = _; left = (lazy left); right = (lazy right); left_trail; @@ -70,15 +70,15 @@ module SketchyEquality = struct let quickfixes _ = [] end -module IsAsAlways = struct - type t = Typing_warning.IsAsAlways.t +module Is_as_always = struct + type t = Typing_warning.Is_as_always.t - let code { Typing_warning.IsAsAlways.kind; _ } = + let code { Typing_warning.Is_as_always.kind; _ } = match kind with - | Typing_warning.IsAsAlways.Is_is_always_true -> Codes.IsIsAlwaysTrue - | Typing_warning.IsAsAlways.Is_is_always_false -> Codes.IsIsAlwaysFalse - | Typing_warning.IsAsAlways.As_always_succeeds _ -> Codes.AsAlwaysSucceeds - | Typing_warning.IsAsAlways.As_always_fails -> Codes.AsAlwaysFails + | Typing_warning.Is_as_always.Is_is_always_true -> Codes.IsIsAlwaysTrue + | Typing_warning.Is_as_always.Is_is_always_false -> Codes.IsIsAlwaysFalse + | Typing_warning.Is_as_always.As_always_succeeds _ -> Codes.AsAlwaysSucceeds + | Typing_warning.Is_as_always.As_always_fails -> Codes.AsAlwaysFails let codes = [ @@ -90,46 +90,46 @@ module IsAsAlways = struct let lint_severity _ = Lints_core.Lint_warning - let claim { Typing_warning.IsAsAlways.kind; lhs_ty; rhs_ty } = + let claim { Typing_warning.Is_as_always.kind; lhs_ty; rhs_ty } = Printf.sprintf (match kind with - | Typing_warning.IsAsAlways.Is_is_always_true -> + | Typing_warning.Is_as_always.Is_is_always_true -> "This `is` check is always `true`. The expression on the left has type %s which is a subtype of %s." - | Typing_warning.IsAsAlways.Is_is_always_false -> + | Typing_warning.Is_as_always.Is_is_always_false -> "This `is` check is always `false`. The expression on the left has type %s which shares no values with %s." - | Typing_warning.IsAsAlways.As_always_succeeds _ -> + | Typing_warning.Is_as_always.As_always_succeeds _ -> "This `as` assertion will always succeed and hence is redundant. The expression on the left has a type %s which is a subtype of %s." - | Typing_warning.IsAsAlways.As_always_fails -> + | Typing_warning.Is_as_always.As_always_fails -> "This `as` assertion will always fail and lead to an exception at runtime. The expression on the left has type %s which shares no values with %s.") (Markdown_lite.md_codify lhs_ty) (Markdown_lite.md_codify rhs_ty) let reasons _ = [] - let lint_code { Typing_warning.IsAsAlways.kind; _ } = + let lint_code { Typing_warning.Is_as_always.kind; _ } = match kind with - | Typing_warning.IsAsAlways.Is_is_always_true -> + | Typing_warning.Is_as_always.Is_is_always_true -> Lints_codes.Codes.is_always_true - | Typing_warning.IsAsAlways.Is_is_always_false -> + | Typing_warning.Is_as_always.Is_is_always_false -> Lints_codes.Codes.is_always_false - | Typing_warning.IsAsAlways.As_always_succeeds _ -> + | Typing_warning.Is_as_always.As_always_succeeds _ -> Lints_codes.Codes.as_always_succeeds - | Typing_warning.IsAsAlways.As_always_fails -> + | Typing_warning.Is_as_always.As_always_fails -> Lints_codes.Codes.as_always_fails - let lint_quickfix { Typing_warning.IsAsAlways.kind; _ } = + let lint_quickfix { Typing_warning.Is_as_always.kind; _ } = match kind with - | Typing_warning.IsAsAlways.Is_is_always_true - | Typing_warning.IsAsAlways.Is_is_always_false - | Typing_warning.IsAsAlways.As_always_fails -> + | Typing_warning.Is_as_always.Is_is_always_true + | Typing_warning.Is_as_always.Is_is_always_false + | Typing_warning.Is_as_always.As_always_fails -> None - | Typing_warning.IsAsAlways.As_always_succeeds quickfix -> Some quickfix + | Typing_warning.Is_as_always.As_always_succeeds quickfix -> Some quickfix let quickfixes _ = [] end -module SketchyNullCheck = struct - type t = Typing_warning.SketchyNullCheck.t +module Sketchy_null_check = struct + type t = Typing_warning.Sketchy_null_check.t let code = Codes.SketchyNullCheck @@ -141,7 +141,7 @@ module SketchyNullCheck = struct let lint_severity _ = Lints_core.Lint_warning - let claim { Typing_warning.SketchyNullCheck.name; kind; ty } = + let claim { Typing_warning.Sketchy_null_check.name; kind; ty } = let name = Option.value name ~default:"$x" in "This is a sketchy null check on an expression of type " @@ -152,14 +152,14 @@ module SketchyNullCheck = struct ^ "If you only meant to test for `null`, " ^ match kind with - | Typing_warning.SketchyNullCheck.Coalesce -> + | Typing_warning.Sketchy_null_check.Coalesce -> Printf.sprintf "use `%s ?? $default` instead of `%s ?: $default`" name name - | Typing_warning.SketchyNullCheck.Eq -> + | Typing_warning.Sketchy_null_check.Eq -> Printf.sprintf "use `%s is null` instead" name - | Typing_warning.SketchyNullCheck.Neq -> + | Typing_warning.Sketchy_null_check.Neq -> Printf.sprintf "use `%s is nonnull` instead" name let reasons _ = [] @@ -169,8 +169,8 @@ module SketchyNullCheck = struct let lint_quickfix _ = None end -module NonDisjointCheck = struct - type t = Typing_warning.NonDisjointCheck.t +module Non_disjoint_check = struct + type t = Typing_warning.Non_disjoint_check.t let code = Codes.NonDisjointCheck @@ -182,7 +182,7 @@ module NonDisjointCheck = struct let lint_severity _ = Lints_core.Lint_warning - let claim { Typing_warning.NonDisjointCheck.name; ty1; ty2; dynamic } = + let claim { Typing_warning.Non_disjoint_check.name; ty1; ty2; dynamic } = Printf.sprintf "%s to '%s' will always return the same value, because type %s is disjoint from type %s." (if dynamic then @@ -200,8 +200,8 @@ module NonDisjointCheck = struct let lint_quickfix _ = None end -module CastNonPrimitive = struct - type t = Typing_warning.CastNonPrimitive.t +module Cast_non_primitive = struct + type t = Typing_warning.Cast_non_primitive.t let code = Codes.CastNonPrimitive @@ -213,7 +213,7 @@ module CastNonPrimitive = struct let lint_severity _ = Lints_core.Lint_error - let claim { Typing_warning.CastNonPrimitive.cast_hint; ty } = + let claim { Typing_warning.Cast_non_primitive.cast_hint; ty } = Printf.sprintf ("Casting %s to %s: casting a non-primitive type to a primitive rarely yields a useful value. " ^^ "Did you mean to extract a value from this object before casting it, or to do a null-check?" @@ -228,10 +228,10 @@ module CastNonPrimitive = struct let lint_quickfix _ = None end -module TruthinessTest = struct - open Typing_warning.TruthinessTest +module Truthiness_test = struct + open Typing_warning.Truthiness_test - type t = Typing_warning.TruthinessTest.t + type nonrec t = t let code = Codes.TruthinessTest @@ -308,10 +308,10 @@ module TruthinessTest = struct let lint_quickfix _ = None end -module EqualityCheck = struct - open Typing_warning.EqualityCheck +module Equality_check = struct + open Typing_warning.Equality_check - type t = Typing_warning.EqualityCheck.t + type t = Typing_warning.Equality_check.t let code = Codes.EqualityCheck @@ -354,10 +354,10 @@ module EqualityCheck = struct let lint_quickfix _ = None end -module DuplicatedProperties = struct - open Typing_warning.DuplicateProperties +module Duplicated_properties = struct + open Typing_warning.Duplicate_properties - type t = Typing_warning.DuplicateProperties.t + type t = Typing_warning.Duplicate_properties.t let code = Codes.DuplicateProperties @@ -415,26 +415,26 @@ end let module_of (type a x) (kind : (x, a) Typing_warning.kind) : (module Warning with type t = x) = match kind with - | Typing_warning.Sketchy_equality -> (module SketchyEquality) - | Typing_warning.Is_as_always -> (module IsAsAlways) - | Typing_warning.Sketchy_null_check -> (module SketchyNullCheck) - | Typing_warning.Non_disjoint_check -> (module NonDisjointCheck) - | Typing_warning.Cast_non_primitive -> (module CastNonPrimitive) - | Typing_warning.Truthiness_test -> (module TruthinessTest) - | Typing_warning.Equality_check -> (module EqualityCheck) - | Typing_warning.Duplicate_properties -> (module DuplicatedProperties) + | Typing_warning.Sketchy_equality -> (module Sketchy_equality) + | Typing_warning.Is_as_always -> (module Is_as_always) + | Typing_warning.Sketchy_null_check -> (module Sketchy_null_check) + | Typing_warning.Non_disjoint_check -> (module Non_disjoint_check) + | Typing_warning.Cast_non_primitive -> (module Cast_non_primitive) + | Typing_warning.Truthiness_test -> (module Truthiness_test) + | Typing_warning.Equality_check -> (module Equality_check) + | Typing_warning.Duplicate_properties -> (module Duplicated_properties) let module_of_migrated (type x) (kind : (x, Typing_warning.migrated) Typing_warning.kind) : (module Lint with type t = x) = match kind with - | Typing_warning.Is_as_always -> (module IsAsAlways) - | Typing_warning.Sketchy_null_check -> (module SketchyNullCheck) - | Typing_warning.Non_disjoint_check -> (module NonDisjointCheck) - | Typing_warning.Cast_non_primitive -> (module CastNonPrimitive) - | Typing_warning.Truthiness_test -> (module TruthinessTest) - | Typing_warning.Equality_check -> (module EqualityCheck) - | Typing_warning.Duplicate_properties -> (module DuplicatedProperties) + | Typing_warning.Is_as_always -> (module Is_as_always) + | Typing_warning.Sketchy_null_check -> (module Sketchy_null_check) + | Typing_warning.Non_disjoint_check -> (module Non_disjoint_check) + | Typing_warning.Cast_non_primitive -> (module Cast_non_primitive) + | Typing_warning.Truthiness_test -> (module Truthiness_test) + | Typing_warning.Equality_check -> (module Equality_check) + | Typing_warning.Duplicate_properties -> (module Duplicated_properties) let code_is_enabled tcopt code = match TypecheckerOptions.hack_warnings tcopt with