google / google/closure-compiler

Circular references and long namespaces

Open
#1,772 0 comments 0 reactions 0 assignees View on GitHub
Modules
Dominant language
JavaScript
Stars
7.7k
Forks
1.2k
Avg merge
2d 12h
Merged PRs (30d)
6

Description

I'm using goog.modules and there are some cases where circular references mean I need:

``` javascript
goog.module("a.b.c.x");
const y = goog.module.get("a.b.c.y");

goog.module("a.b.c.y");
const x = goog.require("a.b.c.x");
```

However some change in the past 3 months has broken the use of local aliases in type annotations:

``` javascript
/**
* @type {y}
*/
this.yyy = null;
```

```
myfile.js:26: WARNING - Bad type annotation. Unknown type module$contents$a$b$c$x_y
24|
25| /**
26| * @type {y}
27| */
28| this.yyy = null;
```

Instead I now need to use the full long namespace:

``` javascript
/**
* @type {a.b.c.y}
*/
this.yyy = null;
```

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.