-
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.
Summary: Replace lossy hashing as a way to avoid non-termination with a set of some explicit termination strategies. The main source of non-termination comes from polymorphism and how it interacts with subtyping and type inference in the system. Via polymorphism it is easy to set up types such that simplifying a subtyping constraint generates expanded versions of essentially the same flow constraint, in ways that are difficult to detect statically. This diff installs some general strategies to avoid non-termination: 1. Force unique instantiations for a polymorphic definition per use in code. 2. Avoid expanding type applications when doing so may cause unbounded recursion (the finite unfoldings should be enough). It is important to note that these strategies are not proved to form a complete set of defenses. As such, a recursion limiter is necessary for us to debug cases as they come up and think of additional defenses. However, I now feel confident that we're mostly there. For example, this diff handles the kind of recursive type aliases required for zero-or-more and one-or-more Promise wrapped types, for structural matching of generic interfaces, and so on. Fixes #514 Fixes #376 Reviewed By: @bhosmer Differential Revision: D2119022
- Loading branch information
1 parent
419d159
commit 7a4a629
Showing
22 changed files
with
774 additions
and
252 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
Oops, something went wrong.