Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[optional-chaining] Create
method_action
type to prepare for option…
…al chain method calls Summary: To support optionally-chained method calls, we will need to handle the case where we look up a method on a receiver and find that it is optional, then "filter out" the nullish components of the type before passing the non-null function to a `CallT`. This work is built in later diffs, but this diff modifies `MethodT` (and relatedly, `CallElemT`) so that instead of containing a `funcalltype` representing the call that the looked-up method will flow to, it contains a new ocaml type called `method_action`. Method actions are currently just `CallM`, which represents the current, non-optional behavior of methods where the looked-up method is directly called. `CallM`s are converted to `CallT`s after methods are looked up. In later dfiffs we will add `ChainM`s, which are converted to `OptionalChainT`s and support optional chain method calls, but this diff just sets up for that. Reviewed By: panagosg7 Differential Revision: D18302024 fbshipit-source-id: 12101d9e5adeff5773c2015210d23bf122af085e
- Loading branch information
1 parent
114a341
commit 33cacfe
Showing
7 changed files
with
104 additions
and
42 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 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