Likely to cause new Flow errors:
- A failed attempt to match a member of a union no longer changes the types that later attempts see, which can find errors that were missed. (e.g. try-Flow)
- Flow now infers the type arguments of a generic call by matching its arguments and its expected type against the signature directly, rather than by solving temporary type variables through subtyping. Some inferred types change, and some errors move from an argument to the place where the call's result is used.
- Errors about a type application (a type that is not polymorphic, a value used as a type) are now reported once, where the application is written, including for applications of generic type parameters and of
any-typed values untyped-type-importerrors are now always on (the lint was on by default already). Delete references to the lint in your.flowconfigandflowlintcomments — the setting is a no-op for this release and will be removed in a future release.internal-typeerrors are now always on (the lint was on by default already). Delete references to the lint in your.flowconfigandflowlintcomments — the setting is a no-op for this release and will be removed in a future release.invalid-this-argerrors are now always on (the lint was on by default already). Delete references to the lint in your.flowconfigandflowlintcomments — the setting is a no-op for this release and will be removed in a future release.libdef-overrideerrors are now always on (the lint was on by default already). Delete references to the lint in your.flowconfigandflowlintcomments — the setting is a no-op for this release and will be removed in a future release.nested-componenterrors are now always on (the lint was on by default already, butall=warn,all=offor an explicit setting could weaken it). Delete references to the lint in your.flowconfigandflowlintcomments — the setting is a no-op for this release and will be removed in a future release.nested-hookerrors are now always on (the lint was on by default already, butall=warn,all=offor an explicit setting could weaken it). Delete references to the lint in your.flowconfigandflowlintcomments — the setting is a no-op for this release and will be removed in a future release.unsafe-object-assignerrors are now always on (the lint was on by default already, butall=warn,all=offor an explicit setting could weaken it). Delete references to the lint in your.flowconfigandflowlintcomments — the setting is a no-op for this release and will be removed in a future release.react-intrinsic-overlaperrors are now always on and can no longer be turned off with lint settings. Suppress them with$FlowFixMe[react-intrinsic-overlap]. Delete references to the lint in your.flowconfigandflowlintcomments — the setting is a no-op for this release and will be removed in a future release.T[K]of an optional property now includesvoid; some errors involving optional properties are reported at different locations or with different codes.
New Features:
undefinedis always accepted as a type annotation.experimental.undefined_typeonly acceptstrue.
Notable bug fixes:
- An interface that extends a type alias whose type parameters all have defaults no longer loses the members it inherits when imported
- Type references inside a
declare namespaceblock now resolve classes, enums and values declared in the namespace's other blocks, as they already did when the declaration was imported - A callback parameter's hint no longer includes
voidfrom members of a union hint that do not take the parameter. - Arguments of
yield,yield*andreturnin annotated generators are now checked with the annotation as a hint, as in TypeScript, andAsyncGeneratoris covariant in its yield and return types likeGenerator. - Testing a property against a union of literals that includes
nullorundefinedno longer drops members whose property isnullorvoid. Underexperimental.ts_void, testing a property againstundefinedor a literal narrows away members whose property isvoid. - Under
experimental.ts_void, fixed a spuriousmissing-local-annoton a callback whose call has another callback that returns no value. - Type-argument errors on
newof a value with a construct signature are reported at thenewexpression instead of the signature's declaration. Promise.resolve()returnsPromise<void>, and a return hint no longer makes an overloaded call fail when an overload accepts its arguments.
Misc:
- Document the
flow-upgradepackage on flow.org.