-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't give quickfixes for object-object casts; only member expressions
Summary: The "did you mean?" quickfix is meant to apply to member expressions, but erroneously they used to also be given for object subtyping errors where it's less clear how to apply a fix. This diff filters out those situations so that the quickfix is only suggested where intended. It turns off suggesting fixes for `LookupT`s that were spawned from object-object subtyping checks. Some React-related tests had to be updated because they involve error messages which used to have "did you mean?" suggestions but now don't. We could avoid this by letting some error messages say "did you mean?" while not emitting quickfixes. But upon inspecting these test cases, the changes seem for the better; the "did you mean?" suggestions that were in the error messages seemed backwards, telling the user to change the upper bound their code was being checked against rather than the lower bound coming from the incorrect code. Reviewed By: dsainati1 Differential Revision: D20609278 fbshipit-source-id: 969021db5ceb613ffb0c2c5f5de6e255cc010841
- Loading branch information
1 parent
91515e7
commit 598b7bc
Showing
6 changed files
with
79 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
// @flow | ||
|
||
type T = {| foo: string |}; | ||
({floo: '123'}: T); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters