google / google/closure-compiler
Allow inline return types between parameters and code block
Open
enhancement
P3
- Dominant language
- JavaScript
- Stars
- 7.7k
- Forks
- 1.2k
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 6
Description
```
class Foo {
bar(/** string */ arg) /** number */ { return arg.length + 1; }
get baz() /** string */ { return 'xyz'; }
}
```
This would be a reasonable way to write return types, and mirrors typescript syntax pretty well (as well as other languages, like Go), so it shouldn't be too surprising.
Contributor guide
Assessment
This issue has not been assessed yet.