-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
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 freezes when 'merging inference' #2702
Comments
state: {matrix: Array<Array<boolean>>} = {matrix: _.times(5, () => _.times(5, () => false))}; |
thanks @gcanti :) Somehow my mind was stuck with approach i had since usually we define type of state and initialize it separately in the constructor. Anyhow in my original scenario flow should either be a) error b) it should succeed without freezing. |
Looks similar to #1570 somehow (> "something" flow does not like make it ultra slow) |
Is this still relevant? |
Not relevant to me anymore. Not sure if the issue would still exist though. |
This probably can be closed in favor of newer feedback. |
Flow checker freezes completely with following code:
my flow definitions for lodash looks like following:
few ways how i can get it fixed:
(1. Move
state = {matrix: _.times(5, () => _.times(5, () => false))};
to constructor:
(2. Declare _.times to return any:
declare function times<T>(n: number, iteratee: (i: number) => T): any;
(3. Remove _.set:
this.setState({matrix: this.state.matrix})
Anyone of above is not optimal solution, and last of them breaks the logic. Just wanted to point it out to narrow the problem.
declaring state outside of the constructor should be valid javascript. Webpack&babel compiles it just fine and it works like expected.
The text was updated successfully, but these errors were encountered: