google / google/closure-compiler
@nocollapse doesn't prevent collapse warning
- Dominant language
- JavaScript
- Stars
- 7.7k
- Forks
- 1.2k
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 6
Description
``` js
var a = {};
a.b = {};
/** @record @nocollapse */
a.b.c = function() {}
console.log(a.b);
```
With COLLAPSE_PROPERTIES, this works fine:
``` js
var a$b = {};
/**@record */a$b.c = function() {
};
console.log(a$b);
```
However, it still gives a collapse warning:
> input0:6: WARNING - incomplete alias created for namespace a.b
> console.log(a.b);
http://closure-compiler-debugger.appspot.com/#input0%3Dvar%2520a%2520%253D%2520%257B%257D%253B%250Aa.b%2520%253D%2520%257B%257D%253B%250A%252F**%2520%2540record%2520%2540nocollapse%2520*%252F%2520%250Aa.b.c%2520%253D%2520function()%2520%257B%257D%250A%250Aconsole.log(a.b)%253B%26input1%26conformanceConfig%26externs%26refasterjs-template%26includeDefaultExterns%3D1%26CHECK_SYMBOLS%3D1%26CHECK_TYPES%3D1%26COLLAPSE_PROPERTIES%3D1%26MISSING_PROPERTIES%3D1%26PRESERVE_TYPE_ANNOTATIONS%3D1%26PRETTY_PRINT%3D1
Contributor guide
Assessment
This issue has not been assessed yet.