We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Flow is a little dumb when it comes to spread.
// @flow const data = { event: ((): string => { return 'archive' })(), createdAt: +Date.now(), id: 1, }; (data: { event: string, createdAt: number, id: number, }); ({ ...data, event: 'archive', createdAt: new Date(data.createdAt), }: { event: 'archive', createdAt: Date, id: number, })
Gives the following output:
15: ({ ^ Cannot cast object literal to object type because number [1] is incompatible with `Date` [2] in property `createdAt`. References: 11: createdAt: number, ^ [1] 21: createdAt: Date, ^ [2] 15: ({ ^ Cannot cast object literal to object type because string [1] is incompatible with string literal `archive` [2] in property `event`. References: 10: event: string, ^ [1] 20: event: 'archive', ^ [2]
Wat? 🤔
The text was updated successfully, but these errors were encountered:
Duplicate of #6108.
Sorry, something went wrong.
No branches or pull requests
Flow is a little dumb when it comes to spread.
Gives the following output:
Wat? 🤔
The text was updated successfully, but these errors were encountered: