Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[flow][tests] Do not aggressively invalidate refinements in loops for…
… const-like variables Summary: This diff fixed the issue shown in the previous diff. The problem is that we see the Val has changed, because inside the loop we have a latent refinement (from `if (f(v)`) being applied to it. While in general it seems to hard to avoid these bad interactions, I think we can at least avoid it for const-like variables. For const-like variables, we should be able to always keep the outer refinements. Changelog: [fix] Flow will no longer invalidate refinements made before the loop for const-like variables within a loop ([example](https://flow.org/try/#1N4Igxg9gdgZglgcxALlAIwIZoKYBsD6uEEAztvhgE6UYCe+JADpdhgCYowa5kA0I2KAFcAtiRQAXSkOz9sADwxgJ+NPTbYuQ3BMnTZA+Y2yU4IwRO4A6SFBIrGVDGM7c+h46fNRLuKxJIGWh8MeT0ZfhYlCStpHzNsFBAMIQkIEQwJODAQfiEyfBE4eWw2fDgofDBMsAALfAA3KjgsXGxxZC4eAw0G-GhcWn9aY3wWZldu-g1mbGqJUoBaCRHEzrcDEgBrbAk62kXhXFxJ923d-cPRHEpTgyEoMDaqZdW7vKgoOfaSKgOKpqmDA+d4gB5fMA-P6LCCMLLQbiLOoYCqgh6-GDYRYIXYLSgkRZkCR4jpddwPfJLZjpOBkO4AX34kA0SQ0Tyo2AABDAHso4NBuQAKBrITn2UxQBAASlFaGIzygAG4ADpQVU8x7wqCchb2YWi8UVBCcgA+nKOuClnOAqs5nLgME5ws5AF4XebtJbrba7ZyWBIhJQlT76T6AO61OBtJ1SGRWm3a30Op0wYVS+OcgD0mc5swa-Pyg05JkoEEovHNEDDnIgW1FUGgV2Ofs0FWw3gk9pInJ2cJ9vpbAaDKsTdtDifH49yIAaJhI-KgSQy9hMIHpQA)) Reviewed By: jbrown215 Differential Revision: D68224844 fbshipit-source-id: 27db5bc4555ab4ce1d120997e8764f5d53b04a78
- Loading branch information