Repository navigation
Fix Flow types that use void for a missing value (#2263) - #2263
Conversation
|
@SamChou19815 has exported this pull request. If you are a Meta employee, you can view the originating Diff in D133660832. |
Metro review: Looks goodRisk: low · Commit: The PR changes only Flow types so that Metro type-checks under No findings. Verified
Not run: I didn't type-check with Automated review by Claude. Advisory only: it never approves or blocks, and a maintainer makes the call. |
Summary: Under Flow's `experimental.ts_void`, `void` is TypeScript's `void`, which flows only into `void`, `any` and `unknown`, so a value typed `void` can't be passed where an optional value is expected. This updates Metro's Flow types for projects that check Metro's sources with that option: RAM bundle `encoding` parameters become optional parameters, the bundle output's `save()` returns `Promise<void>`, two test helpers admit `void`, and the two errors whose only fix needs the `undefined` type, which this repository's Flow config doesn't enable, are suppressed. Without that option, `void` and `undefined` are the same type, so nothing changes. Changelog: [Internal] Differential Revision: D133660832
void for a missing valuevoid for a missing value (#2263)
456b7ca to
4e68f47
Compare
Summary:
Under Flow's
experimental.ts_void,voidis TypeScript'svoid, which flows only intovoid,anyandunknown, so a value typedvoidcan't be passed where an optional value is expected. This updates Metro's Flow types for projects that check Metro's sources with that option: RAM bundleencodingparameters become optional parameters, the bundle output'ssave()returnsPromise<void>, two test helpers admitvoid, and the two errors whose only fix needs theundefinedtype, which this repository's Flow config doesn't enable, are suppressed.Without that option,
voidandundefinedare the same type, so nothing changes.Changelog: [Internal]
Differential Revision: D133660832