Skip to content

Commit 759970c

Browse files
gkzfacebook-github-bot
authored andcommitted
Remove inexact-spread lint
Summary: After jbrown215's changes to spread, this lint is no longer relevant. Reviewed By: jbrown215 Differential Revision: D19241113 fbshipit-source-id: 6ea5b54fb6137a2b4b0ef220a429aca475abeb14
1 parent 16d749b commit 759970c

File tree

6 files changed

+3
-37
lines changed

6 files changed

+3
-37
lines changed

src/common/lints/lints.ml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ type lint_kind =
3434
| DeprecatedUtility
3535
| DynamicExport
3636
| UnsafeGettersSetters
37-
| InexactSpread
3837
| UnnecessaryOptionalChain
3938
| UnnecessaryInvariant
4039
| SignatureVerificationFailure
@@ -68,7 +67,6 @@ let string_of_kind = function
6867
| DeprecatedUtility -> "deprecated-utility"
6968
| DynamicExport -> "dynamic-export"
7069
| UnsafeGettersSetters -> "unsafe-getters-setters"
71-
| InexactSpread -> "inexact-spread"
7270
| UnnecessaryOptionalChain -> "unnecessary-optional-chain"
7371
| UnnecessaryInvariant -> "unnecessary-invariant"
7472
| SignatureVerificationFailure -> "signature-verification-failure"
@@ -102,7 +100,6 @@ let kinds_of_string = function
102100
| "deprecated-utility" -> Some [DeprecatedUtility]
103101
| "dynamic-export" -> Some [DynamicExport]
104102
| "unsafe-getters-setters" -> Some [UnsafeGettersSetters]
105-
| "inexact-spread" -> Some [InexactSpread]
106103
| "unnecessary-optional-chain" -> Some [UnnecessaryOptionalChain]
107104
| "unnecessary-invariant" -> Some [UnnecessaryInvariant]
108105
| "signature-verification-failure" -> Some [SignatureVerificationFailure]

src/common/lints/lints.mli

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ type lint_kind =
3434
| DeprecatedUtility
3535
| DynamicExport
3636
| UnsafeGettersSetters
37-
| InexactSpread
3837
| UnnecessaryOptionalChain
3938
| UnnecessaryInvariant
4039
| SignatureVerificationFailure

src/typing/debug_js.ml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2917,8 +2917,6 @@ let dump_error_message =
29172917
| EUnnecessaryOptionalChain (loc, _) ->
29182918
spf "EUnnecessaryOptionalChain (%s)" (string_of_aloc loc)
29192919
| EUnnecessaryInvariant (loc, _) -> spf "EUnnecessaryInvariant (%s)" (string_of_aloc loc)
2920-
| EInexactSpread (reason, reason_op) ->
2921-
spf "EInexactSpread (%s, %s)" (dump_reason cx reason) (dump_reason cx reason_op)
29222920
| EUnexpectedTemporaryBaseType loc ->
29232921
spf "EUnexpectedTemporaryBaseType (%s)" (string_of_aloc loc)
29242922
| ECannotDelete (l1, r1) -> spf "ECannotDelete (%s, %s)" (string_of_aloc l1) (dump_reason cx r1)

src/typing/errors/error_message.ml

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,6 @@ and 'loc t' =
267267
| EOptionalChainingMethods of 'loc
268268
| EUnnecessaryOptionalChain of 'loc * 'loc virtual_reason
269269
| EUnnecessaryInvariant of 'loc * 'loc virtual_reason
270-
| EInexactSpread of 'loc virtual_reason * 'loc virtual_reason
271270
| EUnexpectedTemporaryBaseType of 'loc
272271
| ECannotDelete of 'loc * 'loc virtual_reason
273272
| EBigIntNotYetSupported of 'loc virtual_reason
@@ -734,7 +733,6 @@ let rec map_loc_of_error_message (f : 'a -> 'b) : 'a t' -> 'b t' =
734733
| EOptionalChainingMethods loc -> EOptionalChainingMethods (f loc)
735734
| EUnnecessaryOptionalChain (loc, r) -> EUnnecessaryOptionalChain (f loc, map_reason r)
736735
| EUnnecessaryInvariant (loc, r) -> EUnnecessaryInvariant (f loc, map_reason r)
737-
| EInexactSpread (r1, r2) -> EInexactSpread (map_reason r1, map_reason r2)
738736
| EUnexpectedTemporaryBaseType loc -> EUnexpectedTemporaryBaseType (f loc)
739737
| ECannotDelete (l1, r1) -> ECannotDelete (f l1, map_reason r1)
740738
| EBigIntNotYetSupported r -> EBigIntNotYetSupported (map_reason r)
@@ -980,7 +978,6 @@ let util_use_op_of_msg nope util = function
980978
| EOptionalChainingMethods _
981979
| EUnnecessaryOptionalChain _
982980
| EUnnecessaryInvariant _
983-
| EInexactSpread _
984981
| EUnexpectedTemporaryBaseType _
985982
| ECannotDelete _
986983
| EBigIntNotYetSupported _
@@ -1011,7 +1008,6 @@ let loc_of_msg : 'loc t' -> 'loc option = function
10111008
| EComparison (primary, _)
10121009
| EFunPredCustom ((primary, _), _)
10131010
| EDynamicExport (_, primary)
1014-
| EInexactSpread (_, primary)
10151011
| EInvalidTypeArgs (_, primary)
10161012
| ETooFewTypeArgs (primary, _, _)
10171013
| ETooManyTypeArgs (primary, _, _) ->
@@ -1226,7 +1222,6 @@ let kind_of_msg =
12261222
| ESketchyNumberLint (kind, _) -> LintError (Lints.SketchyNumber kind)
12271223
| EUnnecessaryOptionalChain _ -> LintError Lints.UnnecessaryOptionalChain
12281224
| EUnnecessaryInvariant _ -> LintError Lints.UnnecessaryInvariant
1229-
| EInexactSpread _ -> LintError Lints.InexactSpread
12301225
| ESignatureVerification _ -> LintError Lints.SignatureVerificationFailure
12311226
| EImplicitInexactObject _ -> LintError Lints.ImplicitInexactObject
12321227
| EAmbiguousObjectType _ -> LintError Lints.AmbiguousObjectType
@@ -2717,22 +2712,6 @@ let friendly_message_of_msg : Loc.t t' -> Loc.t friendly_message_recipe =
27172712
]
27182713
in
27192714
Normal { features }
2720-
| EInexactSpread (reason, reason_op) ->
2721-
let features =
2722-
[
2723-
text "Cannot determine the type of ";
2724-
ref reason_op;
2725-
text " because ";
2726-
text "it contains a spread of inexact ";
2727-
ref reason;
2728-
text ". ";
2729-
text "Being inexact, ";
2730-
ref reason;
2731-
text " might be missing the types of some properties that are being copied. ";
2732-
text "Perhaps you could make it exact?";
2733-
]
2734-
in
2735-
Normal { features }
27362715
| EBigIntNotYetSupported reason ->
27372716
Normal { features = [text "BigInt "; ref reason; text " is not yet supported."] }
27382717
| ECannotSpreadInterface { spread_reason; interface_reason } ->
@@ -3027,7 +3006,6 @@ let is_lint_error = function
30273006
| EUnsafeGettersSetters _
30283007
| ESketchyNullLint _
30293008
| ESketchyNumberLint _
3030-
| EInexactSpread _
30313009
| EBigIntNotYetSupported _
30323010
| EUnnecessaryOptionalChain _
30333011
| EUnnecessaryInvariant _

src/typing/flow_js.ml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5084,8 +5084,8 @@ struct
50845084
with reads of those properties through X as soon as O2 is resolved. To
50855085
avoid this race, we make O2 flow to ObjAssignToT(_,O1,X,ObjAssign);
50865086
when O2 is resolved, we make the switch. **)
5087-
| ( DefT (lreason, _, ObjT { props_tmap = mapr; flags; dict_t; _ }),
5088-
ObjAssignFromT (use_op, reason_op, to_obj, t, ObjAssign error_flags) ) ->
5087+
| ( DefT (lreason, _, ObjT { props_tmap = mapr; dict_t; _ }),
5088+
ObjAssignFromT (use_op, reason_op, to_obj, t, ObjAssign _) ) ->
50895089
Context.iter_props cx mapr (fun x p ->
50905090
(* move the reason to the call site instead of the definition, so
50915091
that it is in the same scope as the Object.assign, so that
@@ -5110,11 +5110,8 @@ struct
51105110
(Error_message.EPropNotReadable { reason_prop; prop_name = Some x; use_op }));
51115111
if dict_t <> None then
51125112
rec_flow_t cx trace ~use_op (AnyT.make Untyped reason_op, t)
5113-
else (
5114-
if error_flags.assert_exact && not flags.exact then
5115-
add_output cx ~trace (Error_message.EInexactSpread (lreason, reason_op));
5113+
else
51165114
rec_flow_t cx trace ~use_op (to_obj, t)
5117-
)
51185115
| ( DefT (lreason, _, InstanceT (_, _, _, { own_props; proto_props; _ })),
51195116
ObjAssignFromT (use_op, reason_op, to_obj, t, ObjAssign _) ) ->
51205117
let own_props = Context.find_props cx own_props in

tests/spread/.flowconfig

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
11
[options]
22
no_flowlib=false
33
all=true
4-
5-
[lints]
6-
inexact-spread=error

0 commit comments

Comments
 (0)