google / google/closure-compiler
property type wrong
- Dominant language
- JavaScript
- Stars
- 7.7k
- Forks
- 1.2k
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 6
Description
I have several boolean properties defined with `Object.defineProperties` on my class prototype returning the value with a `get` function. Unfortunately, I cannot use them as parameter where a boolean is required:
```
myfile.js:309: ERROR - actual parameter 2 of Date.prototype.strftime does not match formal parameter
found : {get: function (this:myCtrl): boolean}
required: (boolean|undefined)
return this.format ? d.strftime(this.format, this.showUtc) : d.toString();
^^^^^^^^^^^^
```
Casting to `boolean` also does not work, though coercing the value with `!!` does work.
Contributor guide
Assessment
This issue has not been assessed yet.