Typing[4361] An exception occurred while typechecking
- Dominant language
- C++
- Stars
- 18.7k
- Forks
- 3.1k
- Avg merge
- 1h 47m
- Merged PRs (30d)
- 2
Description
**Describe the bug**
An exception occurred while typechecking
**Standalone code, or other way to reproduce the problem**
1. Create `Foo.hack` as :
```hack
namespace App;
interface IFoo {
}
final class Foos {
private vec $foos;
public function __construct(IFoo ...$foos = vec[]) {
$this->foos = vec($foos);
}
}
```
2. Create `Bar.hack` as :
```hack
namespace App;
final class Bar {
private ?Foos $foos = null;
}
```
3. Run `touch .hhconfig`
4. Run `hh_client restart`
5. Run `hh_client`
**Expected behavior**
```console
➜ hh_client
Parsing[1002] A variadic parameter ('...') must not have a default value.
--> Foo.hack
9 | public function __construct(IFoo ...$foos = vec[]) {
| ^^^^^^^^^^^^^^^^^^^^
1 error found.
```
**Actual behavior**
```console
➜ hh_client
Typing[4361] An exception occurred while typechecking this. Please file a bug.
--> Bar.hack
3 | final class Bar {
| ^^^^^^^^^^^^^^^^^
Parsing[1002] A variadic parameter ('...') must not have a default value.
--> Foo.hack
9 | public function __construct(IFoo ...$foos = vec[]) {
| ^^^^^^^^^^^^^^^^^^^^
2 errors found.
```
**Environment**
- Ubuntu 18.04
- apt-get with dl.hhvm.com repository
```console
➜ hh_client --version
hackc-f1be4ccd34a71c94959e53ce98357d79f9a86e04-4.57.0
➜ hhvm --version
HipHop VM 4.57.0 (rel)
Compiler: 1589215700_122020453
Repo schema: d1ae8e21bf3419a65f12a010527485564e719d07
➜
```
Contributor guide
Assessment
This issue has not been assessed yet.