google / google/closure-compiler
Incorrect incomplete alias warning for descendent aliases
- Dominant language
- JavaScript
- Stars
- 7.7k
- Forks
- 1.2k
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 6
Description
``` js
var a = {};
a.b = {};
a.b.f1 = function(){};
a.b.f2 = function(){};
a.b.f3 = function(){};
/** @record */
a.b.f2.d = function() {};
console.log(a.b);
```
With COLLAPSE_PROPERTIES on.
`a.b.f2.d` is collapsed, but all of the direct children of `a.b` still exist normally (which is the point of accessing `a.b`).
However, I still get
> input0:11: WARNING - incomplete alias created for namespace a.b
> console.log(a.b);
This makes adding a type anywhere under any existing namespace a breaking change (if you have warnings as errors).
Can you only show that warning when making an alias that has collapsed _direct_ properties?
Contributor guide
Assessment
This issue has not been assessed yet.