google / google/closure-compiler
"missing require" warning when calling methods of values of object literals
Open
bug
P3
- Dominant language
- JavaScript
- Stars
- 7.7k
- Forks
- 1.2k
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 6
Description
When running -
`java -jar closure-compiler-v20180610.jar --js trial.js --language_in ECMASCRIPT_NEXT -O ADVANCED_OPTIMIZATIONS --jscomp_warning '*' --warning_level VERBOSE --js_output_file trial.min.js`
Where trial.js is -
```js
const foo = {baz: "baz"};
/** @return {boolean} */
function call()
{
return foo.baz.includes("a");
}
```
I wrongly get -
```
trial.js:6: WARNING - missing require: 'foo.baz'
return foo.baz.includes("a");
^^^^^^^^^^^^^^^^^^^^^
0 error(s), 1 warning(s), 91.9% typed
```
Contributor guide
Assessment
This issue has not been assessed yet.