Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: Why do this? Because https://fb.workplace.com/groups/243017208059499/posts/250089417352278/?comment_id=254015380293015 * Currently, setLinkedRecords accepts `records: Array<?RecordProxy>`. This means it cannot be called with an `Array<RecordProxy>`, because `setLinkedRecords` would not be prevented from calling `array.push(null)`, violating the type of the array where `setLinkedRecord` is called. * This is a somewhat famous problem in Java * Flow works around this by requiring that array params are invariant, hence an `Array<RecordProxy>` cannot be passed in where an `Array<?RecordProxy>` is accepted. * However, flow treats `$ReadOnlyArray<T>` differently. It is valid to pass an item with type `$ReadOnlyArray<T>` to a function expecting a `$ReadOnlyArray<?T>`. * This diff changes `setLinkedRecords` to accept `$ReadOnlyArray<?RecordProxy>` instead of `Array<RecordProxy>` Differential Revision: D44346850 fbshipit-source-id: ee0eec9512a44430a0036166b7c003bbede7e4f3
- Loading branch information