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
F3553671: D10010.diff
Thu, Dec 26, 8:55 PM
Unknown Object (File)
Sun, Dec 22, 8:57 AM
Unknown Object (File)
Sun, Dec 22, 8:57 AM
Unknown Object (File)
Sun, Dec 22, 8:57 AM
Unknown Object (File)
Sun, Dec 22, 8:57 AM
Unknown Object (File)
Thu, Dec 12, 2:01 AM
Unknown Object (File)
Sun, Dec 1, 8:23 PM
Unknown Object (File)
Fri, Nov 29, 1:32 PM
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