Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Make function type statics stricter
Summary: Before this change, we optimistically typed the statics of a function type as `any`, under the assumption that a function would not be used as an object. In practice, our optimism here is unfounded. This diff changes the type of the statics object for function types to an empty, inexact object type with Function.prototype for its __proto__. This choice is sound with respect to the runtime behaviors while also allowing functions with statics to be valid subtypes via width subtyping. Reviewed By: panagosg7 Differential Revision: D14448564 fbshipit-source-id: 87f6bf50a795760023e1e237856e80587df9f857
- Loading branch information
1 parent
3c5a410
commit b868f61
Showing
6 changed files
with
508 additions
and
218 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
Oops, something went wrong.