-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[flow] Fix incorrect ObjT fast path logic
Summary: Changelog: [errors] We fixed a bug that leads to Flow sometimes ignore the differences in call props of an object. New errors might be exposed. [example](https://flow.org/try/#1N4Igxg9gdgZglgcxALlAIwIZoKYBsD6uEEAztvhgE6UYCe+JADpdhgCYowa5kA0I2KAFcAtiRQAXSkOz9sADwxgJ+NPTbYuQ3BMnTZA+Y2yU4IwRO4A6SFBIrGVDGM7c+h46fNRLuKxJIGWh8MeT0ZfhYlCStpHzNsFBAMIQkIEQwJODAQfiEyfBE4eWw2fDgofDBMsAALfAA3KjgsXGxxZC4eAw0G-GhcWn9aY3wWZldu-g1mbGqJUoBaCRHEzrcDEgBrbAk62kXhXFxJ923d-cPRHEpTgyEoMDaqZdW7vKgoOfaSKgOKpqmDA+d4gB5fMA-P6LCCMLLQbiLOoYCqgh6-GDYRYIXYLSgkRZkCR4jpddwPfJLZjpOBkO4AX34kA0SRWxgABAAVWoPLac1YAHgASgA+dkAXnZwHZAAoAJTIdlC9n0gDcAB0fKt2QBZWjc3n84zCsWSg1QPmC0UaqAaJ5UbDs2z2XX6nkWxV682W43CEQ3EU2r3urbsjAkLkho3YAX2UxQBCB9kAemT7JMlAglEVfpu7IAfmK4xUkPwGiYSHBoEkMvYTCB6UA) Reviewed By: panagosg7 Differential Revision: D55970196 fbshipit-source-id: ea9642eab3ff6921ae25a3ca33a0f5f18bd3a5f7
- Loading branch information
1 parent
8942236
commit c6ce34d
Showing
3 changed files
with
30 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// This is a regression test for incorrect fast-path for objects | ||
// Previously, we enable ObjT ~> ObjT fast path if props_ids are the same, | ||
// which causes us to incorrectly enter the fast path when the call prop has changed. | ||
|
||
type ThunkType<R> = { (): R }; | ||
type MyThunkType<R> = ThunkType<R>; | ||
declare const MyThunk: MyThunkType<number>; | ||
MyThunk as ThunkType<string>; // error: number ~> string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters