This PR is to support variadic parameters with type hint.
function foo(int ...$xs) {
return $xs[0];
}
Variadic parameters will have array type concerning its type hint. The return type of foo will be int in the example.
Typing function(1/0)[0]: foo
^Fun:foo = fun (array(int => int) $xs) -> int
This would improve the precision of analysis of function body. However, application of foo still have an issue. Typing foo(a) tells a is array of int, not int.
This PR is to support variadic parameters with type hint.
Variadic parameters will have array type concerning its type hint. The return type of
foo
will beint
in the example.This would improve the precision of analysis of function body. However, application of
foo
still have an issue. Typingfoo(a)
tellsa
is array of int, not int.