google / google/closure-compiler
Cannot compile static properties for classes; static methods are fine
Open
internal-issue-created
- Dominant language
- JavaScript
- Stars
- 7.7k
- Forks
- 1.2k
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 6
Description
```
class Test {
static myTest = "abc";
}
```
fails to compile.
I'm getting around this by doing
```
class Test {
static get myTest() { return "abc" };
}
```
and `@language_out ES5` flag to get some kind of output.
Sadly, static property inheritance seems to really trip up the compiler. Before I relied on static values in my classes, I was able to get it to compile and work on the advanced setting - might even consider reverting my changes just to get it to work 100% again.
Any recommendations also welcome.
Contributor guide
Assessment
This issue has not been assessed yet.