-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Open
Description
Flow version: 0.100.0
The attached tryflow link shows some examples of every not being used for type refinement.
I'd expect that Flow would see those refinements and not throw any errors.
The same applies for .filter(i => i != null).
Here is the same code inline for easier inspection before going to the tryflow link:
const a = [3, null];
if (a.every(Boolean)) {
(a: Array<number>); // expected no error
}
if (a.every(b => b != null)) {
(a: Array<number>); // expected no error
}
(a.filter(b => b != null): Array<number>); // expected no error
// Note that this pattern is supported
(a.filter(Boolean): Array<number>);Reactions are currently unavailable