google / google/closure-compiler
Inline annotations for optional parameters requires ES6 syntax
Open
- Dominant language
- JavaScript
- Stars
- 7.7k
- Forks
- 1.2k
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 6
Description
I think this should be supported simply by this:
`function foo(/** (string|undefined) */ optional) { ... }`
since calling `foo()` with no arguments will give the `optional` parameter the `undefined` value.
On the other hand, maybe this could be supported as well:
`function foo(/** string= */ optional) { ... }`
Currently this generates no warning or error, but the `=` seems to be silently ignored.
Contributor guide
Assessment
This issue has not been assessed yet.