-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[flow] add option to create sound versions of literal types in type_f…
…ilter Summary: Without this change in functions like ``` const fn = (x: 'a'| 'b') => x !== 'a'; ``` after D67983681 we'd infer a `StrT_UNSOUND('b')` as the type guard for `x`. This is not ideal as this type is directly lifted to an annotation where these unsound types behave particularly poorly. So, instead, we introduce a mode where: * the coercions of `SingletonStrT ~> StrT_UNSOUND`, etc. are disallowed * Type_filter never produces `StrT_UNSOUND`, etc. For now this change has no effect, because `with_disallowed_unsound_literal_coercsion` is never called. This starts being used in D67983681. Changelog: [internal] Reviewed By: SamChou19815 Differential Revision: D68339060 fbshipit-source-id: ebb5ed7e7f808f025b7ce4b7665005ffb1fd2cac
- Loading branch information
1 parent
4dd90e3
commit 9eccbcd
Showing
7 changed files
with
96 additions
and
55 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
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
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