Type untyped parameters with default expressions as union of any with the default expression type
Summary:
In partial mode, an untyped parameter with a default expression is treated as having the type of the default expression. That's not quite right: values with other types can flow to the parameter, we should deal with this, but in a way that is consistent with the rules for partial mode.
One way to think about a default expression is as a conditional assignment. So
```
function foo($x = e) {
...
}
```
is equivalent (in terms of typing, not semantics!) to
```
function foo($x) {
if (something) $x = e;
}
```
For untyped parameters, this means just taking the union of the type of `e` with `Tany`.
Note that for typed parameters, we check that the type of the default expression is a subtype of the declared type, so the union is redundant.
The issue was observed under new_inference, where
```
function foo($x = darray[]) {
}
```
ended up giving a very strict typing to `$x`, namely `darray<nothing,nothing>`.
Reviewed By: CatherineGasnier
Differential Revision:
D14800828
fbshipit-source-id:
8ad410cb233b434336dc77e5ee0c2061a1b9e62a