Flow: Spread with undefined and exact objects

Created on 5 Apr 2019  路  5Comments  路  Source: facebook/flow

I found a couple of issues with spread operator but most of them seem to have problem with optional values ( https://github.com/facebook/flow/issues/7210 ). This is not the case. The problem is that undefined behaves magically like any

Flow version:
0.96 - and many versions before

Expected behavior

undefined is incompatible with string

Actual behavior

See the following snippet

spread bug

Most helpful comment

This will be solved when my current project lands. Thanks for the example!

All 5 comments

Just for fun, here is the same sample code with TypeScript (works as expected there). I use (only) Flow, I'm just curious what the state of the two JS-type projects is.

I think @jbrown215 is working around spreads right now, he might want to have a look at this.

This will be solved when my current project lands. Thanks for the example!

@jbrown215 any approximate time estimate ?

The fixes for spreads have landed, and this has the expected behavior in master.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

damncabbage picture damncabbage  路  3Comments

ctrlplusb picture ctrlplusb  路  3Comments

cubika picture cubika  路  3Comments

ghost picture ghost  路  3Comments

glenjamin picture glenjamin  路  3Comments