###v0.18.0
Likely to cause new Flow errors:
- Flow is now stricter (and more consistent) about how
null
works when used as an initialization value for object properties that are mutated later. Solet o = {prop: null}; o.prop = 42;
is now an error and requires thatnull
be annotated in the object initializer:let o = {prop: (null: ?number};
. - The return type of RegExp.prototype.match() is now properly annotated to return a nullable. As a result, 0.18 may uncover places where .match() wasn't properly being guarded for a null return value.
New Features:
- We now take advantage of the guarantee that
const
variables are read-only when doing refinements. This means that refiningconst
variables now has far fewer caveats than refininglet
s orvar
s!