[hack] Recursive constraints now supported
[hack] Recursive constraints now supported

Summary:
Currently, Hack does not permit type parameters to have constraints that contain the type parameter itself, directly or by mutual recursion between
type parameters. In contrast, Java, C# and Scala *do* permit such constraints, and they are used in common patterns (in Hack syntax) such as the code below.
This feature is sometimes referred to as "F-bounded polymorphism" in the research literature.

```
// An interface with a "binary" method
interface IComparable<T> {
  function CompareTo(T $x) : int;
  }

class TreeSet<T as IComparable<T>> { ... }

class MyWidget implements IComparable<MyWidget> { ... }

// Now we can make use of TreeSet<MyWidget>
```

Note that recursion through type parameters *alone* is still outlawed. For example, we reject
```
class C<T as T>

and

class C<T as Tu, Tu as T>
```

There is nothing inherently wrong with such cycles, but the current subtyping algorithm would loop on such types without further checks.

Reviewed By: dlreeves

Differential Revision: D3322861

fbshipit-source-id: c58ee20ed0f719a4a3e2a5ac6d8826f3e031ed0f

claudiopro/flow,mroch/flow,mroch/flow,AgentME/flow,JonathanUsername/flow,ForbesLindesay/flow,jdelStrother/flow,chenglou/flow,JonathanUsername/flow,ForbesLindesay/flow,MichaelDeBoey/flow,chenglou/flow,TiddoLangerak/flow,AprilArcus/flow,samwgoldman/flow,fletcherw/flow,cesarandreu/flow,claudiopro/flow,ylu1317/flow,gabelevi/flow,facebook/flow,jeffmo/flow,gabro/flow,jdelStrother/flow,jgrund/flow,AprilArcus/flow,popham/flow,popham/flow,jdelStrother/flow,samwgoldman/flow,jamesgpearce/flow,jeffmo/flow,samwgoldman/flow,TiddoLangerak/flow,MichaelDeBoey/flow,gabelevi/flow,TiddoLangerak/flow,chenglou/flow,chenglou/flow,gabro/flow,ylu1317/flow,samwgoldman/flow,jamesgpearce/flow,facebook/flow,AprilArcus/flow,jamesgpearce/flow,TiddoLangerak/flow,ylu1317/flow,claudiopro/flow,nmote/flow,jamesgpearce/flow,nmote/flow,TiddoLangerak/flow,popham/flow,jeffmo/flow,JonathanUsername/flow,jeffmo/flow,jgrund/flow,fletcherw/flow,popham/flow,nmote/flow,jdelStrother/flow,JonathanUsername/flow,gabro/flow,fletcherw/flow,nmote/flow,chenglou/flow,JonathanUsername/flow,facebook/flow,fletcherw/flow,mroch/flow,MichaelDeBoey/flow,nmote/flow,ForbesLindesay/flow,ylu1317/flow,chenglou/flow,jgrund/flow,jgrund/flow,AgentME/flow,jeffmo/flow,cesarandreu/flow,AgentME/flow,gabelevi/flow,AgentME/flow,facebook/flow,JonathanUsername/flow,claudiopro/flow,samwgoldman/flow,facebook/flow,facebook/flow,jamesgpearce/flow,AprilArcus/flow,popham/flow,nmote/flow,samwgoldman/flow,gabro/flow,jdelStrother/flow,gabelevi/flow,gabelevi/flow,AprilArcus/flow,fletcherw/flow,ForbesLindesay/flow,facebook/flow,popham/flow,jamesgpearce/flow,MichaelDeBoey/flow,cesarandreu/flow,ForbesLindesay/flow,jamesgpearce/flow,gabro/flow,jdelStrother/flow,mroch/flow,jeffmo/flow,popham/flow,cesarandreu/flow,nmote/flow,gabelevi/flow,jgrund/flow,JonathanUsername/flow,mroch/flow,mroch/flow,claudiopro/flow,ForbesLindesay/flow,gabro/flow,MichaelDeBoey/flow,gabelevi/flow,fletcherw/flow,ylu1317/flow,samwgoldman/flow,AgentME/flow,mroch/flow,jgrund/flow,AprilArcus/flow