Page MenuHomePhabricator

[Flow202][native][skip-ci] [26/x] Fix Flow issues with types of variables that get mutated
ClosedPublic

Authored by ashoat on Nov 27 2023, 12:45 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mar 5 2024, 7:43 AM
Unknown Object (File)
Mar 5 2024, 7:43 AM
Unknown Object (File)
Mar 5 2024, 7:43 AM
Unknown Object (File)
Mar 5 2024, 7:43 AM
Unknown Object (File)
Dec 14 2023, 1:26 PM
Unknown Object (File)
Dec 14 2023, 10:06 AM
Unknown Object (File)
Dec 13 2023, 5:48 AM
Unknown Object (File)
Dec 13 2023, 5:48 AM
Subscribers

Details

Summary

This the native counterpart of D9774 (web), D9706 / D9692 (lib), and D9858 (keyserver).

There are two main categories of changes here, and both pertain to variables getting mutated:

  1. let declarations where the variable is reassigned later
  2. const declarations of mutable collections that are mutated later

In both of these cases, Flow now wants us to annotate the declaration to cover both the type of the data that's initialized, and also the mutations that later occur.

NOTE: CI will fail on this diff. I considered the possibility of fixing Flow errors BEFORE upgrading Flow, but it wasn't possible... in some cases, the fixes to support the new version o f Flow caused errors in the old version. I could have hidden these type errors with $FlowFixMe lines and then later revert those, but that seemed like too much busy work.

Depends on D10009

Test Plan

Confirm the Flow errors go away

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable