-
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][lib] restrict typing of Array.concat
Summary: Before, given the declaration ``` declare class $ReadOnlyArray<+T> { ... concat<S, Item: $ReadOnlyArray<S> | S>(...items: Array<Item>): Array<T | S>; ... } ``` the following forms were errors ``` declare const arr: Array<number>; arr.concat(); arr.concat() as Array<number>; ``` * The first due to under-constrained `S` * The second due to inferring a bad bound (`mixed`) which is incompatible with `number` This change makes `.concat` behave better when called without arguments. Changelog: [fix] improved definition of `Array.concat()`. Reviewed By: gkz Differential Revision: D67421211 fbshipit-source-id: b48516259e80e94134f07320504e0e4dffd35d79
- Loading branch information
1 parent
14a12b2
commit 3aa18b0
Showing
5 changed files
with
33 additions
and
30 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