google / google/closure-compiler

Caught Error has the unknown type

Open
#1,893 9 comments 0 reactions 0 assignees View on GitHub
internal-issue-created triage-done
Dominant language
JavaScript
Stars
7.7k
Forks
1.2k
Avg merge
2d 12h
Merged PRs (30d)
6

Description

I'm trying to get `100% typed` in my projects but currently all caught errors have the unknown type and I cannot reach 100%.

``` javascript
try {
JSON.parse('{}');
} catch (/** !Error */ e) {
console.log(e);
}
```

This results in `87.5% typed`. If I remove `console.log(e);` line I will get 100%.

I tried `--jscomp_warning 'reportUnknownTypes'` and got
in NTI:

```
test.js:4: WARNING - This NAME expression has the unknown type.
console.log(e);
^
```

in OTI:

```
test.js:4: WARNING - could not determine the type of this expression
console.log(e);
^
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.