Instantiate constructor tparams if they exist
Summary:
Rewriting for effect polymorphism introduces non-denotable type parameters on functions. Type parameters are currently banned on constructor definitions, because the type argument list in a `new` expression is used to parametrize the class.
I've loosened the restriction to allow type parameters that start with `T$` (i.e. non-denotable) and create fresh type variables for them. Then the constructor call is checked as any other function call. Here's a minor visualization of what's happening.
```
class C<T as A> {
public function __construct(T $a)[$a::C]: void {}
}
== rewrite ==>
class C<T as A> {
public function __construct<T$a@C>(T $a)[$a::C]: void where T$a@C = T::C {}
}
== elsewhere ==>
new C<B>($b);
== interpreted as ==>
new C<B><_>($b);
^^^^ (class targs)
^^^ (constructor targs)
```
Reviewed By: DavidSnider, losvald
Differential Revision:
D25632044
fbshipit-source-id:
55b890787dcf0997f6b48d031d2b991ec82b1ff0