flow icon indicating copy to clipboard operation
flow copied to clipboard

Self-require in spread assignment causes object type to be `any`

Open bhosmer opened this issue 10 years ago • 1 comments

M.js

// @flow
const obj = { ...require('./M') };
(obj: string); // cast to whatever
(obj.x);         // any prop, etc.

bhosmer avatar Jun 15 '16 02:06 bhosmer

This is intentional. A self require is any and then spreading any will make the result any 👍

calebmer avatar Jul 27 '17 15:07 calebmer