Stricter enforcement of arity for unpacked arguments
Summary:
This diff adds a typechecker option to be stricter with argument unpacking. Consider the following function:
```
function max<T as num>(
T $first,
T $second,
T ...$rest,
): T;
```
The typechecker currently allows us to call the function like this:
```
$max = max(...$my_numbers);
```
If that particular Container has no elements, this will be a runtime exception. This diff requires that, when the option is set, that users pass in at least two arguments, and unpack the rest, or use a function that supports Containers:
```
$max = max($first, $second, ...$my_numbers);
// OR:
$max = max2($my_numbers);
```
Note that, in case of a tuple, we will allow the arguments to be unpacked because we can guarantee the arity:
```
$my_numbers = tuple(1, 2);
$max = max(...$my_numbers); // OK
```
Reviewed By: jamesjwu
Differential Revision:
D6926957
fbshipit-source-id:
27942e0420d4e5d31c22493e72ea45689c6bd666