-
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.
model x.foo++ with a new Number Val.write_state
Summary: This diff fixes duplicate errors we see on things like: ``` //flow type O = {foo?: number}; declare var o: O; o.foo++; ``` as mentioned in the previous diff. These duplicate errors were caused because we were unifying the read of o.foo with the write of o.foo. `o.foo++` always creates a number, so this effectively unified `void | number` with `number`. The reason we unified the reads and writes is because we set the write of `o.foo++` in the env builder at the location of `o.foo`. Since these operations always produce a number, there is no real reason to record a location and use the env to look it up. Instead we, introduce a new Val.write_state that represents a number. This allows us to avoid the clashing key issue entirely. Changelog: [internal] Reviewed By: SamChou19815 Differential Revision: D35200715 fbshipit-source-id: 97557c2ab6e0a981a6012392ea673a112ec7ab80
- Loading branch information
1 parent
0fbdcc1
commit 25e9495
Showing
5 changed files
with
30 additions
and
5 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
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
This file was deleted.
Oops, something went wrong.